July 28, 2015
HPC Made Easy
Let's consider the problem of performing a lot of numerical experiments using some third-party solver to generate training data for an approximation model. Each solver run may be time-consuming, and performing multiple calculations on a single computer can take plenty of time.
Calculation performance can be increased using computer clusters. pSeven provides integration with the following types of cluster resource manager software:
- LSF / OpenLava
Integration with computer clusters is provided by the Program block which also supports the Job Array mechanism simplifying management of collections of similar tasks.
To solve the problem we use the 2.04 General - Approximation model training project from pSeven examples. The workflow generates a data sample which is used both as the solver input sample and as the input part of the model training sample.
Solver is a Composite block containing the sub-workflow which processes a single input data vector.
The Solver block expanded:
The Solver block has the "Parallel execution" option enabled, which allows the block to automatically process the input sample matrix as a list of input vectors. The option also defines how many instances of the internal workflow can run simultaneously (the parallelization ratio).
The Launcher block command:
How to Speed Up the Workflow
If the solver has high requirements to CPU or memory resources, running multiple solvers on the same a single computer is ineffective.
Let's modify the Launcher block settings:
- Select the Slurm batch manager.
- Specify SSH connection information (host, port, username, and password) to connect to the batch manager host.
- Set file synchronization: "Local to remote" to automatically upload input files for the solver to cluster nodes.
Now the Launcher block will run the solver on the cluster, uploading input files and reading results from solver's output files on execution nodes. Due to parallel execution of the Launcher block instances, the solver on a cluster will be run in parallel too.
Using parallel execution of composite blocks along with running the solver on a computer cluster is an easy way to speed up the workflow by just a few clicks. You may increase performance even further, by making the workflow prepare all input files before submitting the job to the cluster and using a single Program block run to execute a large batch of calculations via the job array mechanism.
By Stanislav Markevich, Senior Software Engineer, DATADVANCE