0

In our slurm cluster we have two different types of nodes:

node12-*   -->   12 cpu cores per node
node20-*   -->   20 cpu cores per node

The node20-* are quite a bit older than the node12-* and therefore are much slower per core. I usually start a lot of jobs at the same time where the calculations only differ in input parameters. By testing I found that I can use the cluster best when my jobs use 2 cores on the node12-* machines and 4 cores on the node20-* machines. My jobscripts therefore would contain

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --ntasks=2
#SBATCH --nodelist=node12-1,node12-2

and

#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --ntasks=4
#SBATCH --nodelist=node20-1,node20-2

respectively. Since all my jobscripts originate from one template I have to make these distinctions manually.

Is there a way to request different sets of resources in one jobscript? In other words I would like to not include the nodelist keyword and instead tell slurm that if I get a node12-* then I want 2 cpu, but if I get a node20-* then I want 4 cpu. Is something like that possible?

noes
  • 49
  • 1
  • 7

1 Answers1

0

As far as I know, the number of CPUs is used to determine which node to schedule the program on. So it should be the other way round, that you specify which nodes to use and with what number of nodes... Therefore, you should explicitly specify the nodes you want to include/exclude.

This can be done via the --nodelist=... or --exclude=....
It might also be possible using the --constraint= keyword (maybe set for number of cores, but I am not sure about this.)
(Unfortunately, this may increase wait times slightly, as you restrict the possible schedule options)

See also the documentation and this question/answer.

Helmut
  • 311
  • 1
  • 9