From 2490f257777dbe76a5c97b528d89b1f1bf26efb3 Mon Sep 17 00:00:00 2001 From: mkuznet1 Date: Mon, 22 Jun 2026 12:28:49 +0000 Subject: [PATCH] feat(slurm): add reservation support to job configuration - Updated SlurmDeployment to include a new "reservation" field in the job configuration, allowing users to specify job reservations. - Modified job.sh.j2 template to conditionally include the reservation directive in the SLURM job script if a reservation is provided. This enhancement improves the flexibility of job submissions in SLURM environments. --- src/madengine/deployment/slurm.py | 1 + src/madengine/deployment/templates/slurm/job.sh.j2 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/madengine/deployment/slurm.py b/src/madengine/deployment/slurm.py index f5fb2495..a5fe7640 100644 --- a/src/madengine/deployment/slurm.py +++ b/src/madengine/deployment/slurm.py @@ -676,6 +676,7 @@ def debug(self, msg): "network_interface": self.slurm_config.get("network_interface"), "exclusive": self.slurm_config.get("exclusive", True), "exclude": self.slurm_config.get("exclude"), + "reservation": self.slurm_config.get("reservation"), "constraint": self.slurm_config.get("constraint"), "nodelist": self._normalize_nodelist(self.slurm_config.get("nodelist")), "qos": self.slurm_config.get("qos"), diff --git a/src/madengine/deployment/templates/slurm/job.sh.j2 b/src/madengine/deployment/templates/slurm/job.sh.j2 index 5f8e8266..3b236d9f 100644 --- a/src/madengine/deployment/templates/slurm/job.sh.j2 +++ b/src/madengine/deployment/templates/slurm/job.sh.j2 @@ -8,6 +8,9 @@ #SBATCH --ntasks-per-node=1 #SBATCH --gpus-per-node={{ gpus_per_node }} #SBATCH --time={{ time_limit }} +{% if reservation %} +#SBATCH --reservation={{ reservation }} +{% endif %} {% if nodelist %} #SBATCH --nodelist={{ nodelist }} {% endif %}