snakemake-executor-plugin-slurm 1.5.0__tar.gz → 1.6.0__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: snakemake-executor-plugin-slurm
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary: A Snakemake executor plugin for submitting jobs to a SLURM cluster.
5
5
  License: MIT
6
6
  Keywords: snakemake,plugin,executor,cluster,slurm
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Classifier: Programming Language :: Python :: 3.13
15
- Requires-Dist: numpy (>=1.26.4,<2.0.0)
15
+ Requires-Dist: numpy (>=1.26.4,<3)
16
16
  Requires-Dist: pandas (>=2.2.3,<3.0.0)
17
17
  Requires-Dist: snakemake-executor-plugin-slurm-jobstep (>=0.3.0,<0.4.0)
18
18
  Requires-Dist: snakemake-interface-common (>=1.13.0,<2.0.0)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "snakemake-executor-plugin-slurm"
3
- version = "1.5.0"
3
+ version = "1.6.0"
4
4
  description = "A Snakemake executor plugin for submitting jobs to a SLURM cluster."
5
5
  authors = [
6
6
  "Christian Meesters <meesters@uni-mainz.de>",
@@ -19,7 +19,7 @@ snakemake-interface-common = "^1.13.0"
19
19
  snakemake-interface-executor-plugins = "^9.1.1"
20
20
  snakemake-executor-plugin-slurm-jobstep = "^0.3.0"
21
21
  pandas = "^2.2.3"
22
- numpy = "^1.26.4"
22
+ numpy = ">=1.26.4, <3"
23
23
  throttler = "^1.2.2"
24
24
 
25
25
  [tool.poetry.group.dev.dependencies]
@@ -366,9 +366,15 @@ class Executor(RemoteExecutor):
366
366
  process.returncode, call, output=err
367
367
  )
368
368
  except subprocess.CalledProcessError as e:
369
- raise WorkflowError(
370
- f"SLURM sbatch failed. The error message was {e.output}"
369
+ self.report_job_error(
370
+ SubmittedJobInfo(job),
371
+ msg=(
372
+ "SLURM sbatch failed. "
373
+ f"The error message was '{e.output.strip()}'.\n"
374
+ f" sbatch call:\n {call}\n"
375
+ ),
371
376
  )
377
+ return
372
378
  # any other error message indicating failure?
373
379
  if "submission failed" in err:
374
380
  raise WorkflowError(
@@ -445,7 +451,7 @@ class Executor(RemoteExecutor):
445
451
 
446
452
  # We use this sacct syntax for argument 'starttime' to keep it compatible
447
453
  # with slurm < 20.11
448
- sacct_starttime = f"{datetime.now() - timedelta(days = 2):%Y-%m-%dT%H:00}"
454
+ sacct_starttime = f"{datetime.now() - timedelta(days=2):%Y-%m-%dT%H:00}"
449
455
  # previously we had
450
456
  # f"--starttime now-2days --endtime now --name {self.run_uuid}"
451
457
  # in line 218 - once v20.11 is definitively not in use any more,
@@ -50,12 +50,19 @@ def get_submit_command(job, params):
50
50
  if job.resources.get("nodes", False):
51
51
  call += f" --nodes={job.resources.get('nodes', 1)}"
52
52
 
53
- # fixes #40 - set ntasks regardless of mpi, because
54
- # SLURM v22.05 will require it for all jobs
55
53
  gpu_job = job.resources.get("gpu") or "gpu" in job.resources.get("gres", "")
56
54
  if gpu_job:
57
- call += f" --ntasks-per-gpu={job.resources.get('tasks', 1)}"
55
+ # fixes #316 - allow unsetting of tasks per gpu
56
+ # apparently, python's internal process manangement interfers with SLURM
57
+ # e.g. for pytorch
58
+ ntasks_per_gpu = job.resources.get(
59
+ "tasks_per_gpu", job.resources.get("tasks", 1)
60
+ )
61
+ if ntasks_per_gpu >= 1:
62
+ call += f" --ntasks-per-gpu={ntasks_per_gpu}"
58
63
  else:
64
+ # fixes #40 - set ntasks regardless of mpi, because
65
+ # SLURM v22.05 will require it for all jobs
59
66
  call += f" --ntasks={job.resources.get('tasks', 1)}"
60
67
 
61
68
  # we need to set cpus-per-task OR cpus-per-gpu, the function