snakemake-executor-plugin-slurm 1.2.0__py3-none-any.whl → 1.2.1__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.

@@ -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 | head -n1'
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
- return sacct_out.replace("(null)", "").strip()
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: "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: snakemake-executor-plugin-slurm
3
- Version: 1.2.0
3
+ Version: 1.2.1
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
@@ -0,0 +1,7 @@
1
+ snakemake_executor_plugin_slurm/__init__.py,sha256=QFAmMAvEkBg6BuEtZIFFrh8IY0C0lxZksEd_WwiCyCU,31472
2
+ snakemake_executor_plugin_slurm/submit_string.py,sha256=sXzMm5SVNQ4upIOcsIZjUqj7khnG-lieo5yJSSus5sc,2483
3
+ snakemake_executor_plugin_slurm/utils.py,sha256=ZzXiXFDVLs15PLJnDP0eq98fNCtzlLbhtT03ec8Ou34,3578
4
+ snakemake_executor_plugin_slurm-1.2.1.dist-info/LICENSE,sha256=YVc4xTLWMqGfFL36120k7rzXtsT6e4RkJsh68VVn12s,1076
5
+ snakemake_executor_plugin_slurm-1.2.1.dist-info/METADATA,sha256=3l9RutnMcL44MmGTqKEOzfAkSMD8EJwyvRO3yYiGtPc,1360
6
+ snakemake_executor_plugin_slurm-1.2.1.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
7
+ snakemake_executor_plugin_slurm-1.2.1.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- snakemake_executor_plugin_slurm/__init__.py,sha256=EqMKNkKYVFeDfw2pwCnFKYxgKOGJazlDm658wvFvQN0,30942
2
- snakemake_executor_plugin_slurm/submit_string.py,sha256=sXzMm5SVNQ4upIOcsIZjUqj7khnG-lieo5yJSSus5sc,2483
3
- snakemake_executor_plugin_slurm/utils.py,sha256=ZzXiXFDVLs15PLJnDP0eq98fNCtzlLbhtT03ec8Ou34,3578
4
- snakemake_executor_plugin_slurm-1.2.0.dist-info/LICENSE,sha256=YVc4xTLWMqGfFL36120k7rzXtsT6e4RkJsh68VVn12s,1076
5
- snakemake_executor_plugin_slurm-1.2.0.dist-info/METADATA,sha256=rOpk-4_-aw3w-2X0POSy6rAvFZnPfzArN6MT9CuUxwA,1360
6
- snakemake_executor_plugin_slurm-1.2.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
7
- snakemake_executor_plugin_slurm-1.2.0.dist-info/RECORD,,