Running Fewer MPI Tasks Than Available Cores
In some edge cases a user may want to only run 1 MPI tasks on a node which contains 8 cores.
Example 1:
To do this change your script to the following:
#!/bin/sh #SBATCH -N 4 # ask for 4 nodes #SBATCH -t 1-03:00:00 # 1 day and 3 hours #SBATCH -p compute # partition name #SBATCH -U chemistry # your project name - contact Ops if unsure what this is #SBATCH -J my_job_name # sensible name for the job mpirun -npernode 1 ./cpi.x
The above assumes that openmpi is being used and will ask for 4 nodes but launch 1 process per node.
Example 2:
example is as follows:
#!/bin/sh #SBATCH -N 8 # ask for 8 nodes #SBATCH -t 1-03:00:00 # 1 day and 3 hours #SBATCH -p compute # partition name #SBATCH -U chemistry # your project name - contact Ops if unsure what this is #SBATCH -J my_job_name # sensible name for the job mpirun -npernode 4 ./cpi.x
This gives you 8 nodes and runs 4 mpi process on each node (i.e. 32 mpi processes in total)