From b48437f6c503fcd713030e481452b5deca0b6aa7 Mon Sep 17 00:00:00 2001 From: candiceT233 Date: Sun, 14 Jan 2024 14:54:42 -0600 Subject: [PATCH 1/2] added nodelist to specify running nodes --- jarvis_util/shell/slurm_exec.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jarvis_util/shell/slurm_exec.py b/jarvis_util/shell/slurm_exec.py index 63d7439..95caf06 100644 --- a/jarvis_util/shell/slurm_exec.py +++ b/jarvis_util/shell/slurm_exec.py @@ -36,6 +36,7 @@ def __init__(self, cmd, exec_info): self.gres = exec_info.gres self.exclusive = exec_info.exclusive self.host_suffix = exec_info.host_suffix + self.nodelist = exec_info.nodelist super().__init__(self.slurmcmd(), exec_info.mod(env=exec_info.basic_env)) @@ -56,7 +57,8 @@ def generate_sbatch_command(self): 'error': 'error', 'mem': 'mem', 'gres': 'gres', - 'exclusive': 'exclusive' + 'exclusive': 'exclusive', + 'nodelist': 'nodelist', } for attr, option in options_map.items(): @@ -82,7 +84,7 @@ class SlurmExecInfo(ExecInfo): def __init__(self, job_name=None, num_nodes=1, **kwargs): super().__init__(exec_type=ExecType.SLURM, **kwargs) allowed_options = ['job_name', 'num_nodes', 'cpus_per_task', 'time', 'partition', 'mail_type', - 'mail_user', 'mem', 'gres', 'exclusive', 'host_suffix'] + 'mail_user', 'mem', 'gres', 'exclusive', 'host_suffix', 'nodelist'] self.keys += allowed_options # We use ppn, and the output and error file from the base Exec Info for key in allowed_options: From f4e8771a46eb390bc40cb3771990a0bee6af0e30 Mon Sep 17 00:00:00 2001 From: candiceT233 Date: Tue, 23 Jan 2024 18:11:33 -0600 Subject: [PATCH 2/2] fix ppn maps to slurm ntasks-per-node --- jarvis_util/shell/slurm_exec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jarvis_util/shell/slurm_exec.py b/jarvis_util/shell/slurm_exec.py index 95caf06..89fa8a6 100644 --- a/jarvis_util/shell/slurm_exec.py +++ b/jarvis_util/shell/slurm_exec.py @@ -48,7 +48,7 @@ def generate_sbatch_command(self): options_map = { 'job_name': 'job-name', 'num_nodes': 'nodes', - 'ppn': 'ntasks', + 'ppn': 'ntasks-per-node', 'cpus_per_task': 'cpus-per-task', 'time': 'time', 'partition': 'partition',