From b4a3bb0edef056f5f30090dd168ae4ae734e1e99 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 13 Nov 2020 19:08:10 +0100 Subject: [PATCH] New stdexp resource specification Now the options cpusPerTask ntasksPerNode nodes and jobName are required for the sbatch stage. Also cpuBind has been removed and is always set to "cores,verbose" in the srun stage. --- garlic/stdexp.nix | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/garlic/stdexp.nix b/garlic/stdexp.nix index 6b90f8c..880a504 100644 --- a/garlic/stdexp.nix +++ b/garlic/stdexp.nix @@ -46,14 +46,15 @@ rec { inherit (config.garlic.sbatch) reservation; } // # However, if the experiment contains a reservation, that takes priority - # over the one set in the ~/.config/nixpkgs/config.nix file - optionalAttrs (conf ? reservation) { - inherit (conf) reservation; - } // + # over the one set in the ~/.config/nixpkgs/config.nix file. Add other + # options if they are defined as well. + optionalInherit [ "reservation" "time" "qos" ] conf // # Finally, add all the other required parameters { + inherit nextStage nixPrefix; + # These sbatch options are mandatory + inherit cpusPerTask ntasksPerNode nodes jobName; exclusive = true; - inherit nextStage nixPrefix nodes ntasksPerNode time qos jobName; } ); @@ -62,10 +63,17 @@ rec { inherit nextStage; }; - srun = {nextStage, conf, ...}: stages.srun { - inherit (conf) nixPrefix cpuBind; - inherit nextStage; - }; + srun = {nextStage, conf, ...}: ( + assert (assertMsg (!(conf ? cpuBind)) + "cpuBind is no longer available in the standard srun stage"); + stages.srun { + inherit (conf) nixPrefix; + inherit nextStage; + + # Binding is set to cores always + cpuBind = "cores,verbose"; + } + ); isolate = {nextStage, conf, ...}: stages.isolate { clusterName = machineConf.name;