To submit jobs to a cluster through slurm, I can specify how many CPUs I want for a job with #SBATCH --ntasks-per-node={cpus}
. However, this will send the job to any node with at least this many CPUs. This is normally fine, but say I'm on a cluster with nodes that have 24 CPUs and 40 CPUs. If I submit a 24 core job, some of them will go to the 40 CPU nodes, blocking further calculations on these nodes (unless they happen to ask for 16 or less).
Is there a way I can specify that I want nodes with at most a certain number of CPUs? I know it is possible to submit the job with a list of the nodes that I would accept, but I was hoping there was a way to do this without manually inserting this list into a variety of different job scripts.