Batch Submission of MPI and OpenMP

There are many different ways to specify to Slurm the requirements of a job, through arguments such as the number of nodes, the number of tasks, memory requirements per task, etc.

We provide here some examples covering the mixes of MPI and OpenMP. This requires knowledge of the underlying hardware, remember SCW standard compute nodes have 40 cores per node, previous systems had less than this, e.g. 16 cores per node on Sandy Bridge systems.

MPI

A job of 160 parallel processes, distributed as 40 processes per node, hence occupying 4 nodes:

#SBATCH --ntasks=160
#SBATCH --tasks-per-node=40

 

OpenMP

A job of 8 OpenMP thread, defaulting to 1 node, hence occupying 8 processors of one node:

#SBATCH --cpus-per-task=8

 

MPI + OpenMP

A hybrid MPI + OpenMP job, with 4 MPI tasks, each of 10 OpenMP thread, and distributed one MPI task per node:

#SBATCH --ntasks=4
#SBATCH --cpus-per-task=10
#SBATCH --tasks-per-node=1