Skip to content

Commit

Permalink
Include rule name as comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fgvieira authored Jan 10, 2024
1 parent 914265d commit 9f073c1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions snakemake_executor_plugin_slurm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def run_job(self, job: JobExecutorInterface):
# with job_info being of type
# snakemake_interface_executor_plugins.executors.base.SubmittedJobInfo.

jobid = job.jobid

log_folder = f"group_{job.name}" if job.is_group() else f"rule_{job.name}"

slurm_logfile = os.path.abspath(f".snakemake/slurm_logs/{log_folder}/%j.log")
Expand All @@ -78,7 +76,7 @@ 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`)
call = f"sbatch --job-name {self.run_uuid} -o {slurm_logfile} --export=ALL"
call = f"sbatch --job-name {self.run_uuid} --output {slurm_logfile} --export=ALL --comment {job.name}"

call += self.get_account_arg(job)
call += self.get_partition_arg(job)
Expand Down Expand Up @@ -149,7 +147,7 @@ def run_job(self, job: JobExecutorInterface):
slurm_jobid = out.split(" ")[-1]
slurm_logfile = slurm_logfile.replace("%j", slurm_jobid)
self.logger.info(
f"Job {jobid} has been submitted with SLURM jobid {slurm_jobid} "
f"Job {job.jobid} has been submitted with SLURM jobid {slurm_jobid} "
f"(log: {slurm_logfile})."
)
self.report_job_submission(
Expand Down

0 comments on commit 9f073c1

Please sign in to comment.