I have a job that has 6 MPI processes with 4 OpenMP threads per process. How do I write a SLURM script to submit this job?
18.04.19:
Notes:
- Assumptions:
processor == logical CPU
node hierarchy: node/socket/core/thread
threads per task = cpus per task (see below)
MPI process == MPI task == task
default: 1 cpu per task
=> “OpenMP threads per process” == cpus-per-task == OMP_NUM_THREADS - Node specs not given: we will assume 16 core/node.
- Hyperthreading not turned on (generally not useful for HPC environs).
*For SLURM, this makes one thread per core, and equivalently, one cpu per core - SelectType=select/cons_res
=> CPU is consumable resource
So, “6 MPI processes with 4 OpenMP threads per process” specifies a total of
6 MPI tasks, with 4 threads per task, the latter expressed as OMP_NUM_THREADS = 4
and/or cpus-per-task = 4
. These variables correspond to -n
and -c
, which are the minimum specifications needed to submit a job.
The number of nodes is not specified, so we leave that to SLURM.
#!/bin/bash
#SBATCH --ntasks=6
#SBATCH --cpus-per-task=4
OMP_NUM_THREADS = 4
CURATOR: Torey