From 9d6af3e683f251e718f20509bb88be95aac3d351 Mon Sep 17 00:00:00 2001 From: Albert Zeyer Date: Tue, 3 Dec 2024 18:37:42 +0100 Subject: [PATCH] Slurm, fix ntasks per node to one Fix #229 --- .../simple_linux_utility_for_resource_management_engine.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sisyphus/simple_linux_utility_for_resource_management_engine.py b/sisyphus/simple_linux_utility_for_resource_management_engine.py index 7815666..6c50de1 100644 --- a/sisyphus/simple_linux_utility_for_resource_management_engine.py +++ b/sisyphus/simple_linux_utility_for_resource_management_engine.py @@ -176,6 +176,11 @@ def options(self, rqmt): if rqmt.get("multi_node_slots", 1) > 1: out.append("--ntasks=%s" % rqmt["multi_node_slots"]) out.append("--nodes=%s" % rqmt["multi_node_slots"]) + else: + # With --cpus-per-task=1, it's sometimes possible that we end up with SLURM_NTASKS=2. + # This here prevents this. + # https://github.com/rwth-i6/sisyphus/issues/229 + out.append("--ntasks-per-node=1") sbatch_args = rqmt.get("sbatch_args", []) if isinstance(sbatch_args, str):