Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to limit the number of jobs running on the same node using SLURM?

Tags:

slurm

I have a job array of 100 jobs. I want at most 2 jobs from the job array can be allocated to the same node. How can I do this using SLURM? Thanks!

like image 247
Negelis Avatar asked Oct 26 '25 10:10

Negelis


1 Answers

Assuming that jobs can share nodes, and that nodes have homogeneous configuration, and that you are alone on the cluster,

  1. use the sinfo -Nl command to find the number of CPUs per nodes
  2. submit jobs that request half that number with either of #SBATCH --tasks-per-node=... or #SBATCH --cpus-per-task=... based on what your jobs do

If you are administrating a cluster that is shared among other people, you can define GRES of a dummy type, and assign two of them to each node in slurm.conf and then request one per job with --gres=dummy:1

like image 189
damienfrancois Avatar answered Oct 29 '25 07:10

damienfrancois



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!