From 730cac09c12a7038557ee937bc58c8c9e483c8f3 Mon Sep 17 00:00:00 2001 From: Mitchell Robert Vollger Date: Mon, 6 May 2024 10:39:14 -0700 Subject: [PATCH] feat: wildcards in comment string #85 (#88) Small change to include wildcards in the comment strings (re #85). I tested it locally on my Slurm instance, and it works well. I also prefixed the rule name with `rule_` to match the formatting of the slurm log path. Cheers, Mitchell --- snakemake_executor_plugin_slurm/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snakemake_executor_plugin_slurm/__init__.py b/snakemake_executor_plugin_slurm/__init__.py index cc0255e..69e54dd 100644 --- a/snakemake_executor_plugin_slurm/__init__.py +++ b/snakemake_executor_plugin_slurm/__init__.py @@ -89,9 +89,13 @@ def run_job(self, job: JobExecutorInterface): # generic part of a submission string: # we use a run_uuid as the job-name, to allow `--name`-based # filtering in the job status checks (`sacct --name` and `squeue --name`) + if wildcard_str == "": + comment_str = f"rule_{job.name}" + else: + comment_str = f"rule_{job.name}_wildcards_{wildcard_str}" call = ( f"sbatch --job-name {self.run_uuid} --output {slurm_logfile} --export=ALL " - f"--comment {job.name}" + f"--comment {comment_str}" ) call += self.get_account_arg(job)