File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
snakemake_executor_plugin_slurm Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 6
6
import csv
7
7
from io import StringIO
8
8
import os
9
+ import re
9
10
import subprocess
10
11
import time
11
12
from datetime import datetime , timedelta
@@ -134,6 +135,7 @@ def run_job(self, job: JobExecutorInterface):
134
135
call += f" --cpus-per-task={ get_cpus_per_task (job )} "
135
136
136
137
if job .resources .get ("slurm_extra" ):
138
+ self .check_slurm_extra ()
137
139
call += f" { job .resources .slurm_extra } "
138
140
139
141
exec_job = self .format_job_exec (job )
@@ -479,3 +481,15 @@ def get_default_partition(self, job):
479
481
"'slurm_partition=<your default partition>'."
480
482
)
481
483
return ""
484
+
485
+ def check_slurm_extra (self ):
486
+ jobname = re .compile (r"--job-name[=?|\s+]|-J\s?" )
487
+ if re .search (jobname , job .resources .slurm_extra ):
488
+ raise WorkflowError (
489
+ "The --job-name option is not allowed in the 'slurm_extra' "
490
+ "parameter. The job name is set by snakemake and must not be "
491
+ "overwritten. It is internally used to check the stati of the "
492
+ "all submitted jobs by this workflow."
493
+ "Please consult the documentation if you are unsure how to "
494
+ "query the status of your jobs."
495
+ )
You can’t perform that action at this time.
0 commit comments