SubmitFunction¶
- class SubmitFunction(callable, evals_per_jobs=1, nodes_per_job=1, cpus_per_job=4, timeout_per_job=5, mem=512, slurm_wckey='P120K:SALOME', slurm_additional_parameters={})¶
The aim of this class is to ease the realization of parallel evaluations of a numerical simulation model in a HPC environment. This class gives an example of a HPC wrapper for an executable numerical model using the Python package submitit.
- Parameters:
- callable
openturns.Function
The unit function for which can either be sequential (a unit evaulation only requires one CPU), multi-cores or multi-nodes (a unit evaluation requires multiple cores and possibly multiple nodes).
- evals_per_jobsint
Defines the number of tasks (or evaluations of the numerical simulation model) realized in each single SLURM jobs.
- nodes_per_jobint
Defines the number of HPC nodes requested per SLURM job submitted.
- cpus_per_jobint
Defines the number of CPUs requested per SLURM job submitted.
- timeout_per_jobint
Defines the timeout requested (in minutes) per SLURM job.
- memint
Defines the memory (in MB) requested per node.
- slurm_wckeystr
Only for clusters that require a WCKEY (EDF clusters for example), i.e. a project identification key. To check the current wckeys, use the bash command cce_wckeys.
- slurm_additional_parametersdictionary
Extra parameters to pass to SLURM (for example, {“exclusive”: True, “mem_per_gpu”: 12}). Empty by default.
- callable
Methods
Input description accessor.
Input dimension accessor.
Output description accessor.
Output dimension accessor.
setInputDescription
(descIn)Input description accessor.
setOutputDescription
(descOut)Output description accessor.
Examples
>>> import othpc >>> import openturns as ot >>> from othpc.example import CantileverBeam
>>> cb = CantileverBeam("my_results") >>> slurm_cb = othpc.SubmitFunction(cb) >>> X = [[30e3, 28e6, 250.0, 400.0], [20e3, 35e6, 250.0, 400.0]] >>> Y = slurm_cb(X)
- getInputDescription()¶
Input description accessor.
- getInputDimension()¶
Input dimension accessor.
- getOutputDescription()¶
Output description accessor.
- getOutputDimension()¶
Output dimension accessor.
- setInputDescription(descIn)¶
Input description accessor.
- setOutputDescription(descOut)¶
Output description accessor.