Skip to content

Commit

Permalink
Merge pull request #296 from silverriver/patch-1
Browse files Browse the repository at this point in the history
[Fixbug] Ensure only one task will be launched for each srun cmd
  • Loading branch information
hynky1999 authored Oct 17, 2024
2 parents e648dfe + 846bd62 commit 371c014
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/datatrove/executor/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ def launch_job(self):
srun_args_str = " ".join([f"--{k}={v}" for k, v in self.srun_args.items()]) if self.srun_args else ""
launch_file_contents = self.get_launch_file_contents(
self.get_sbatch_args(max_array),
f"srun {srun_args_str} -l launch_pickled_pipeline {self.logging_dir.resolve_paths('executor.pik')}",
# use "-n 1" for each srun command to enforce that only one task will be launched.
# Some setting may lead to two tasks, see https://groups.google.com/g/slurm-users/c/L4nCXtZLlTo
f"srun {srun_args_str} -l -n 1 launch_pickled_pipeline {self.logging_dir.resolve_paths('executor.pik')}",
)
# save it
with self.logging_dir.open("launch_script.slurm", "w") as launchscript_f:
Expand Down

0 comments on commit 371c014

Please sign in to comment.