Use divisors in the slurm cpu experiment

This commit is contained in:
Rodrigo Arias Mallo 2020-11-16 13:48:07 +01:00
parent 433c8864ea
commit 74537e682c

View File

@ -18,9 +18,9 @@ let
# Initial variable configuration # Initial variable configuration
varConf = with bsc; { varConf = with bsc; {
# Create a list of cpus per task by dividing cpusPerSocket by 2 # Create a list of cpus per task by computing the divisors of the number of
# successively. Example: divList 24 = [ 1 3 6 12 24 ] # cpus per socket, example: divisors 24 = [ 1 2 3 4 6 8 12 24 ]
cpusPerTask = divList hw.cpusPerSocket; cpusPerTask = divisors hw.cpusPerSocket;
}; };
# Generate the complete configuration for each unit # Generate the complete configuration for each unit
@ -36,6 +36,8 @@ let
# Resources # Resources
qos = "debug"; qos = "debug";
inherit (c) cpusPerTask; inherit (c) cpusPerTask;
# As cpusPerTask is a divisor of the cpusPerSocket and thus cpusPerNode, we
# know the remainder is zero:
ntasksPerNode = hw.cpusPerNode / cpusPerTask; ntasksPerNode = hw.cpusPerNode / cpusPerTask;
nodes = 1; nodes = 1;
jobName = unitName; jobName = unitName;