snakemake-executor-plugin-slurm 1.2.0__tar.gz → 1.2.1__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-1.2.0 → snakemake_executor_plugin_slurm-1.2.1}/PKG-INFO +1 -1
- {snakemake_executor_plugin_slurm-1.2.0 → snakemake_executor_plugin_slurm-1.2.1}/pyproject.toml +1 -1
- {snakemake_executor_plugin_slurm-1.2.0 → snakemake_executor_plugin_slurm-1.2.1}/snakemake_executor_plugin_slurm/__init__.py +11 -2
- {snakemake_executor_plugin_slurm-1.2.0 → snakemake_executor_plugin_slurm-1.2.1}/LICENSE +0 -0
- {snakemake_executor_plugin_slurm-1.2.0 → snakemake_executor_plugin_slurm-1.2.1}/README.md +0 -0
- {snakemake_executor_plugin_slurm-1.2.0 → snakemake_executor_plugin_slurm-1.2.1}/snakemake_executor_plugin_slurm/submit_string.py +0 -0
- {snakemake_executor_plugin_slurm-1.2.0 → snakemake_executor_plugin_slurm-1.2.1}/snakemake_executor_plugin_slurm/utils.py +0 -0
|
@@ -261,6 +261,13 @@ class Executor(RemoteExecutor):
|
|
|
261
261
|
"- submitting without. This might or might not work on your cluster."
|
|
262
262
|
)
|
|
263
263
|
|
|
264
|
+
# fixes #40 - set ntasks regardless of mpi, because
|
|
265
|
+
# SLURM v22.05 introduced the requirement for all jobs
|
|
266
|
+
gpu_job = job.resources.get("gpu") or "gpu" in job.resources.get("gres", "")
|
|
267
|
+
if gpu_job:
|
|
268
|
+
call += f" --ntasks-per-gpu={job.resources.get('tasks', 1)}"
|
|
269
|
+
else:
|
|
270
|
+
call += f" --ntasks={job.resources.get('tasks', 1)}"
|
|
264
271
|
# MPI job
|
|
265
272
|
if job.resources.get("mpi", False):
|
|
266
273
|
if not job.resources.get("tasks_per_node") and not job.resources.get(
|
|
@@ -627,12 +634,14 @@ We leave it to SLURM to resume your job(s)"""
|
|
|
627
634
|
tries to deduce the acccount from recent jobs,
|
|
628
635
|
returns None, if none is found
|
|
629
636
|
"""
|
|
630
|
-
cmd = f'sacct -nu "{os.environ["USER"]}" -o Account%256 |
|
|
637
|
+
cmd = f'sacct -nu "{os.environ["USER"]}" -o Account%256 | tail -1'
|
|
631
638
|
try:
|
|
632
639
|
sacct_out = subprocess.check_output(
|
|
633
640
|
cmd, shell=True, text=True, stderr=subprocess.PIPE
|
|
634
641
|
)
|
|
635
|
-
|
|
642
|
+
possible_account = sacct_out.replace("(null)", "").strip()
|
|
643
|
+
if possible_account == "none": # some clusters may not use an account
|
|
644
|
+
return None
|
|
636
645
|
except subprocess.CalledProcessError as e:
|
|
637
646
|
self.logger.warning(
|
|
638
647
|
f"No account was given, not able to get a SLURM account via sacct: "
|
|
File without changes
|
|
File without changes
|
|
File without changes
|