snakemake-executor-plugin-slurm 0.4.2__py3-none-any.whl → 0.4.4__py3-none-any.whl
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/__init__.py +13 -15
- {snakemake_executor_plugin_slurm-0.4.2.dist-info → snakemake_executor_plugin_slurm-0.4.4.dist-info}/METADATA +3 -3
- snakemake_executor_plugin_slurm-0.4.4.dist-info/RECORD +5 -0
- snakemake_executor_plugin_slurm-0.4.2.dist-info/RECORD +0 -5
- {snakemake_executor_plugin_slurm-0.4.2.dist-info → snakemake_executor_plugin_slurm-0.4.4.dist-info}/LICENSE +0 -0
- {snakemake_executor_plugin_slurm-0.4.2.dist-info → snakemake_executor_plugin_slurm-0.4.4.dist-info}/WHEEL +0 -0
|
@@ -18,6 +18,7 @@ from snakemake_interface_executor_plugins.jobs import (
|
|
|
18
18
|
JobExecutorInterface,
|
|
19
19
|
)
|
|
20
20
|
from snakemake_interface_common.exceptions import WorkflowError
|
|
21
|
+
from snakemake_executor_plugin_slurm_jobstep import get_cpus_per_task
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
# Required:
|
|
@@ -65,7 +66,7 @@ class Executor(RemoteExecutor):
|
|
|
65
66
|
# with job_info being of type
|
|
66
67
|
# snakemake_interface_executor_plugins.executors.base.SubmittedJobInfo.
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
group_or_rule = f"group_{job.name}" if job.is_group() else f"rule_{job.name}"
|
|
69
70
|
|
|
70
71
|
try:
|
|
71
72
|
wildcard_str = f"_{'_'.join(job.wildcards)}" if job.wildcards else ""
|
|
@@ -73,9 +74,17 @@ class Executor(RemoteExecutor):
|
|
|
73
74
|
wildcard_str = ""
|
|
74
75
|
|
|
75
76
|
slurm_logfile = os.path.abspath(
|
|
76
|
-
f".snakemake/slurm_logs/{
|
|
77
|
+
f".snakemake/slurm_logs/{group_or_rule}/{wildcard_str}/%j.log"
|
|
77
78
|
)
|
|
78
|
-
os.
|
|
79
|
+
logdir = os.path.dirname(slurm_logfile)
|
|
80
|
+
# this behavior has been fixed in slurm 23.02, but there might be plenty of
|
|
81
|
+
# older versions around, hence we should rather be conservative here.
|
|
82
|
+
assert "%j" not in logdir, (
|
|
83
|
+
"bug: jobid placeholder in parent dir of logfile. This does not work as "
|
|
84
|
+
"we have to create that dir before submission in order to make sbatch "
|
|
85
|
+
"happy. Otherwise we get silent fails without logfiles being created."
|
|
86
|
+
)
|
|
87
|
+
os.makedirs(logdir, exist_ok=True)
|
|
79
88
|
|
|
80
89
|
# generic part of a submission string:
|
|
81
90
|
# we use a run_uuid as the job-name, to allow `--name`-based
|
|
@@ -118,18 +127,7 @@ class Executor(RemoteExecutor):
|
|
|
118
127
|
# fixes #40 - set ntasks regarlless of mpi, because
|
|
119
128
|
# SLURM v22.05 will require it for all jobs
|
|
120
129
|
call += f" --ntasks={job.resources.get('tasks', 1)}"
|
|
121
|
-
|
|
122
|
-
cpus_per_task = job.threads
|
|
123
|
-
if job.resources.get("cpus_per_task"):
|
|
124
|
-
if not isinstance(cpus_per_task, int):
|
|
125
|
-
raise WorkflowError(
|
|
126
|
-
f"cpus_per_task must be an integer, but is {cpus_per_task}"
|
|
127
|
-
)
|
|
128
|
-
cpus_per_task = job.resources.cpus_per_task
|
|
129
|
-
# ensure that at least 1 cpu is requested
|
|
130
|
-
# because 0 is not allowed by slurm
|
|
131
|
-
cpus_per_task = max(1, cpus_per_task)
|
|
132
|
-
call += f" --cpus-per-task={cpus_per_task}"
|
|
130
|
+
call += f" --cpus-per-task={get_cpus_per_task(job)}"
|
|
133
131
|
|
|
134
132
|
if job.resources.get("slurm_extra"):
|
|
135
133
|
call += f" {job.resources.slurm_extra}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: snakemake-executor-plugin-slurm
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: A Snakemake executor plugin for submitting jobs to a SLURM cluster.
|
|
5
5
|
Home-page: https://github.com/snakemake/snakemake-executor-plugin-slurm
|
|
6
6
|
License: MIT
|
|
@@ -12,9 +12,9 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
Requires-Dist: snakemake-executor-plugin-slurm-jobstep (>=0.
|
|
15
|
+
Requires-Dist: snakemake-executor-plugin-slurm-jobstep (>=0.2.0,<0.3.0)
|
|
16
16
|
Requires-Dist: snakemake-interface-common (>=1.13.0,<2.0.0)
|
|
17
|
-
Requires-Dist: snakemake-interface-executor-plugins (>=9.
|
|
17
|
+
Requires-Dist: snakemake-interface-executor-plugins (>=9.1.1,<10.0.0)
|
|
18
18
|
Requires-Dist: throttler (>=1.2.2,<2.0.0)
|
|
19
19
|
Project-URL: Documentation, https://snakemake.github.io/snakemake-plugin-catalog/plugins/executor/slurm.html
|
|
20
20
|
Project-URL: Repository, https://github.com/snakemake/snakemake-executor-plugin-slurm
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
snakemake_executor_plugin_slurm/__init__.py,sha256=g1tVQzQttAG_aJkJ6yFgv5kBLe7Mbx_CTfsUdwO1eio,20100
|
|
2
|
+
snakemake_executor_plugin_slurm-0.4.4.dist-info/LICENSE,sha256=YVc4xTLWMqGfFL36120k7rzXtsT6e4RkJsh68VVn12s,1076
|
|
3
|
+
snakemake_executor_plugin_slurm-0.4.4.dist-info/METADATA,sha256=bDry72OZMEEcfkAUuWZNfBDxO3Sjnv097zt0cjKBNMM,1380
|
|
4
|
+
snakemake_executor_plugin_slurm-0.4.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
5
|
+
snakemake_executor_plugin_slurm-0.4.4.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
snakemake_executor_plugin_slurm/__init__.py,sha256=sgumTnrMWWUTslJywjw_WoX_k5cx-UsMbvnFC9Vn9Ek,19994
|
|
2
|
-
snakemake_executor_plugin_slurm-0.4.2.dist-info/LICENSE,sha256=YVc4xTLWMqGfFL36120k7rzXtsT6e4RkJsh68VVn12s,1076
|
|
3
|
-
snakemake_executor_plugin_slurm-0.4.2.dist-info/METADATA,sha256=gdIN0NyxBGyfGcEkgMrayrwMcrBVIFFkAlD5qr8RThg,1381
|
|
4
|
-
snakemake_executor_plugin_slurm-0.4.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
5
|
-
snakemake_executor_plugin_slurm-0.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|