From 42f2227a9f1a8532222ee3cd833b08eedca30a0b Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 13 Nov 2020 10:17:54 +0100 Subject: [PATCH] sbatch: Use experiment reservation if given --- garlic/stdexp.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/garlic/stdexp.nix b/garlic/stdexp.nix index 7a584de..8764559 100644 --- a/garlic/stdexp.nix +++ b/garlic/stdexp.nix @@ -43,7 +43,14 @@ rec { # experiment, if the reservation is set like with nodes or ntasksPerNode. optionalAttrs (config ? garlic.sbatch.reservation) { 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; + } // + # Finally, add all the other required parameters + { exclusive = true; inherit nextStage nixPrefix nodes ntasksPerNode time qos jobName; }