Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nodelist parameter for slurm; Fix ppn to ntasks-per-node for slurm #48

Merged
merged 4 commits into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions jarvis_util/shell/slurm_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -47,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',
Expand All @@ -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():
Expand All @@ -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:
Expand Down
Loading