Skip to content

Commit

Permalink
fix: bug from issue #97
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeesters committed Jun 4, 2024
1 parent 1ffca4c commit 59bc8ee
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions snakemake_executor_plugin_slurm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,23 @@ def run_job(self, job: JobExecutorInterface):
"- submitting without. This might or might not work on your cluster."
)

# MPI job
if job.resources.get("mpi", False):
if job.resources.get("nodes", False):
call += f" --nodes={job.resources.get('nodes', 1)}"
if job.resources.get("nodes", False):
call += f" --nodes={job.resources.get('nodes', 1)}"

# fixes #40 - set ntasks regarlless of mpi, because
# SLURM v22.05 will require it for all jobs
call += f" --ntasks={job.resources.get('tasks', 1)}"
# MPI job
if job.resources.get("mpi", False):
if not job.resources.get("tasks_per_node") and not job.resources.get(
"nodes"
):
logger.warning(
"MPI job detected, but no 'tasks_per_node' or 'nodes' "
"specified. Assuming 'tasks_per_node=1'."
"Probably not what you want."
)

call += f" --cpus-per-task={get_cpus_per_task(job)}"

if job.resources.get("slurm_extra"):
Expand Down

0 comments on commit 59bc8ee

Please sign in to comment.