From bbe459db1ea98d02e7aa7c774a5d734cd5890ca0 Mon Sep 17 00:00:00 2001 From: Brett Milash Date: Thu, 15 May 2025 09:28:51 -0600 Subject: [PATCH] Enables running snakemake job with slurm cluster reservation. --- snakemake_executor_plugin_slurm/submit_string.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/snakemake_executor_plugin_slurm/submit_string.py b/snakemake_executor_plugin_slurm/submit_string.py index 2da03f69..789cc356 100644 --- a/snakemake_executor_plugin_slurm/submit_string.py +++ b/snakemake_executor_plugin_slurm/submit_string.py @@ -50,6 +50,11 @@ def get_submit_command(job, params): if job.resources.get("nodes", False): call += f" --nodes={job.resources.get('nodes', 1)}" + # Specify reservation for job if any. Reservation name is in + # single quotes since reservation names may include spaces. + if job.resources.get("reservation"): + call += f" --reservation='{job.resources.reservation}'" + # fixes #40 - set ntasks regardless of mpi, because # SLURM v22.05 will require it for all jobs gpu_job = job.resources.get("gpu") or "gpu" in job.resources.get("gres", "")