snakemake-executor-plugin-slurm 0.5.0__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of snakemake-executor-plugin-slurm might be problematic. Click here for more details.
- {snakemake_executor_plugin_slurm-0.5.0 → snakemake_executor_plugin_slurm-0.5.2}/PKG-INFO +1 -1
- {snakemake_executor_plugin_slurm-0.5.0 → snakemake_executor_plugin_slurm-0.5.2}/pyproject.toml +1 -1
- {snakemake_executor_plugin_slurm-0.5.0 → snakemake_executor_plugin_slurm-0.5.2}/snakemake_executor_plugin_slurm/__init__.py +21 -8
- {snakemake_executor_plugin_slurm-0.5.0 → snakemake_executor_plugin_slurm-0.5.2}/LICENSE +0 -0
- {snakemake_executor_plugin_slurm-0.5.0 → snakemake_executor_plugin_slurm-0.5.2}/README.md +0 -0
|
@@ -123,14 +123,23 @@ class Executor(RemoteExecutor):
|
|
|
123
123
|
"- submitting without. This might or might not work on your cluster."
|
|
124
124
|
)
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if job.resources.get("nodes", False):
|
|
129
|
-
call += f" --nodes={job.resources.get('nodes', 1)}"
|
|
126
|
+
if job.resources.get("nodes", False):
|
|
127
|
+
call += f" --nodes={job.resources.get('nodes', 1)}"
|
|
130
128
|
|
|
131
129
|
# fixes #40 - set ntasks regarlless of mpi, because
|
|
132
130
|
# SLURM v22.05 will require it for all jobs
|
|
133
131
|
call += f" --ntasks={job.resources.get('tasks', 1)}"
|
|
132
|
+
# MPI job
|
|
133
|
+
if job.resources.get("mpi", False):
|
|
134
|
+
if not job.resources.get("tasks_per_node") and not job.resources.get(
|
|
135
|
+
"nodes"
|
|
136
|
+
):
|
|
137
|
+
self.logger.warning(
|
|
138
|
+
"MPI job detected, but no 'tasks_per_node' or 'nodes' "
|
|
139
|
+
"specified. Assuming 'tasks_per_node=1'."
|
|
140
|
+
"Probably not what you want."
|
|
141
|
+
)
|
|
142
|
+
|
|
134
143
|
call += f" --cpus-per-task={get_cpus_per_task(job)}"
|
|
135
144
|
|
|
136
145
|
if job.resources.get("slurm_extra"):
|
|
@@ -214,7 +223,7 @@ class Executor(RemoteExecutor):
|
|
|
214
223
|
|
|
215
224
|
# We use this sacct syntax for argument 'starttime' to keep it compatible
|
|
216
225
|
# with slurm < 20.11
|
|
217
|
-
sacct_starttime = f"{datetime.now() - timedelta(days=2):%Y-%m-%dT%H:00}"
|
|
226
|
+
sacct_starttime = f"{datetime.now() - timedelta(days = 2):%Y-%m-%dT%H:00}"
|
|
218
227
|
# previously we had
|
|
219
228
|
# f"--starttime now-2days --endtime now --name {self.run_uuid}"
|
|
220
229
|
# in line 218 - once v20.11 is definitively not in use any more,
|
|
@@ -293,7 +302,9 @@ class Executor(RemoteExecutor):
|
|
|
293
302
|
elif status in fail_stati:
|
|
294
303
|
msg = (
|
|
295
304
|
f"SLURM-job '{j.external_jobid}' failed, SLURM status is: "
|
|
296
|
-
|
|
305
|
+
# message ends with '. ', because it is proceeded
|
|
306
|
+
# with a new sentence
|
|
307
|
+
f"'{status}'. "
|
|
297
308
|
)
|
|
298
309
|
self.report_job_error(j, msg=msg, aux_logs=[j.aux["slurm_logfile"]])
|
|
299
310
|
active_jobs_seen_by_sacct.remove(j.external_jobid)
|
|
@@ -373,7 +384,7 @@ class Executor(RemoteExecutor):
|
|
|
373
384
|
# here, we check whether the given or guessed account is valid
|
|
374
385
|
# if not, a WorkflowError is raised
|
|
375
386
|
self.test_account(job.resources.slurm_account)
|
|
376
|
-
return f" -A {job.resources.slurm_account}"
|
|
387
|
+
return f" -A '{job.resources.slurm_account}'"
|
|
377
388
|
else:
|
|
378
389
|
if self._fallback_account_arg is None:
|
|
379
390
|
self.logger.warning("No SLURM account given, trying to guess.")
|
|
@@ -440,7 +451,9 @@ class Executor(RemoteExecutor):
|
|
|
440
451
|
f"'{account}' with sacctmgr: {e.stderr}"
|
|
441
452
|
)
|
|
442
453
|
|
|
443
|
-
|
|
454
|
+
# The set() has been introduced during review to eliminate
|
|
455
|
+
# duplicates. They are not harmful, but disturbing to read.
|
|
456
|
+
accounts = set(_.strip() for _ in accounts.split("\n") if _)
|
|
444
457
|
|
|
445
458
|
if account not in accounts:
|
|
446
459
|
raise WorkflowError(
|
|
File without changes
|
|
File without changes
|