RunRules¶
This module manages the parameters used to define the mpi and omp parellelization strategy.
- class mppi.Calculators.RunRules.RunRules(scheduler='direct', omp_num_threads=1, mpi=1, nodes=1, ntasks_per_node=1, cpus_per_task=1, gpus_per_node=None, memory=None, time=None, partition=None, account=None, qos=None, map_by=None, pe=1, rank_by=None)[source]¶
Bases:
dictDefines and manage a dictionary with all the parameters needed to set up the rules for parallel computing.
- Parameters:
scheduler (
string) – choose the scheduler used to submit the jobomp_num_threads (
int) – the value of the environment variable OMP_NUM_THREADSmpi (
int) – number of mpi processes. This parameter is used only if scheduler isdirect, otherwise the nodes and ntasks_per_node parameters as used.nodes (
int) – slurm nodes variablentasks_per_node (
int) – slurm ntasks-per-node variablecpus_per_task (
int) – slurm cpus-per-task variablegpus_per_node (
int) – slurm gpus-per-node variablememory (
string) – slurm mem variabletime (
string) – slurm time variable, format ‘HH:MM:SS’partition (
string) – slurm parition variableaccount (
string) – slurm account variableqos (
string) – slurm qos variablemap_by (
string) – the mpi unit for the –map-by option of mpirunpe (
int) – number of processing elements in the –map-by:unit:PE=n option of mpirunrank_by (
string) – the unit for the –rank-by option of mpirun
- mppi.Calculators.RunRules.build_slurm_header(pars)[source]¶
Define the header of the slurm script. Note that the name variable is not present in the RunRules parameter but it is added by the Calculator in the run_options dictionary.
- Parameters:
pars (
dict) – dictionary with the structure of an instance of theRunRules- Returns:
a list with the lines of the header of the script
- Return type:
list