I'm running MPI jobs on a SLURM cluster and want to pin the resultant processes to specific cores on the node. This can include different numbers of processes on different nodes and different pinning patterns on different nodes. This is all relatively easy if I take an allocation of nodes using salloc, and construct a rank file for the mpi processes and start the processes using mpirun.
Unfortunately if the allocation is revoked for any reason such at timing out or pre-emption, the processes running on the nodes are killed, but the mpirun that is executing on the head node is not killed, and goes from generating negligible load to generating 100% load for the thread it is executing in indefinitely.
It would appear that the answer is to use srun instead of mpirun to launch the application, but I am struggling to find out how to set the process placements if I do this. Anyone have any suggestions?
salloc
rather thansbatch
? Is the program interactive? Otherwise, withsbatch
your mainmpirun
process will be killed. – damienfrancois