...
If no specific requests regarding the number of tasks has been done, mpirun
defaults to hyperthreading and starts cores*2
processes. If a number of tasks has been specified (either with -nN
or --tasks-per-node
), mpirun
honors this via the flag -map-by. For example:
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
#!/bin/bash #SBATCH -N 4 module load gcc/9.3.0 openmpi/gcc.9/4.1.4 cpus_per_node=${SLURM_JOB_CPUS_PER_NODE%\(*} mpirun -map-by ppr:$cpus_per_node:node ./yourexe |
...