Skip to content

Commit 7d4b855

Browse files
committed
0.2.1: support for tinygpu using slurm
1 parent 69a4bd2 commit 7d4b855

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

hpc_helper/_hpc_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def build_job_submit_slurm(
250250
sbatch = _check_command_for_target_system("sbatch", target_system=target_system)
251251
sbatch_command = f"{sbatch} --job-name {job_name} --nodes={nodes} --ntasks-per-node={tasks_per_node} "
252252
if target_system == "tinygpu":
253-
sbatch_command += f"gres={gres} "
253+
sbatch_command += f"--gres={gres} "
254254
sbatch_command += f"--time={walltime} --mail-type={mail_type} {script_name} "
255255

256256
sbatch_command = _add_arguments_slurm(sbatch_command, args, **kwargs)

tests/test_hpc_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,28 +164,28 @@ def test_build_job_submit_slurm_raises(self, target_system, expected):
164164
"tinygpu",
165165
None,
166166
{},
167-
"sbatch.tinygpu --job-name Test_Job --nodes=1 --ntasks-per-node=4 "
167+
"sbatch.tinygpu --job-name Test_Job --nodes=1 --ntasks-per-node=4 --gres=gpu:1 "
168168
f"--time=24:00:00 --mail-type=ALL jobscript.sh",
169169
),
170170
(
171171
"tinygpu",
172172
["path1", "path2"],
173173
{},
174-
"sbatch.tinygpu --job-name Test_Job --nodes=1 --ntasks-per-node=4 "
174+
"sbatch.tinygpu --job-name Test_Job --nodes=1 --ntasks-per-node=4 --gres=gpu:1 "
175175
f'--time=24:00:00 --mail-type=ALL jobscript.sh PARAMS="path1 path2"',
176176
),
177177
(
178178
"tinygpu",
179179
["path1", ""],
180180
{"SUBJECT_DIR": "path3"},
181-
"sbatch.tinygpu --job-name Test_Job --nodes=1 --ntasks-per-node=4 "
181+
"sbatch.tinygpu --job-name Test_Job --nodes=1 --ntasks-per-node=4 --gres=gpu:1 "
182182
f'--time=24:00:00 --mail-type=ALL jobscript.sh PARAMS="path1" SUBJECT_DIR=path3',
183183
),
184184
(
185185
"tinygpu",
186186
None,
187187
{"SUBJECT_DIR": "path3"},
188-
"sbatch.tinygpu --job-name Test_Job --nodes=1 --ntasks-per-node=4 "
188+
"sbatch.tinygpu --job-name Test_Job --nodes=1 --ntasks-per-node=4 --gres=gpu:1 "
189189
f"--time=24:00:00 --mail-type=ALL jobscript.sh SUBJECT_DIR=path3",
190190
),
191191
],

0 commit comments

Comments
 (0)