Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 6 additions & 6 deletions superbench/runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,17 @@ def __get_mode_command(self, benchmark_name, mode, timeout=None):
mode_command = (
'{trace} '
'mpirun ' # use default OpenMPI in image
'-tag-output ' # tag mpi output with [jobid,rank]<stdout/stderr> prefix
'-allow-run-as-root ' # allow mpirun to run when executed by root user
'--tag-output ' # tag mpi output with [jobid,rank]<stdout/stderr> prefix
'--allow-run-as-root ' # allow mpirun to run when executed by root user
'{host_list} ' # use prepared hostfile or specify nodes and launch {proc_num} processes on each node
'-bind-to numa ' # bind processes to numa
'--bind-to numa ' # bind processes to numa
'{mca_list} {env_list} {command}'
).format(
trace=trace_command,
host_list=f'-host localhost:{mode.proc_num}' if 'node_num' in mode and mode.node_num == 1 else
f'-hostfile hostfile -map-by ppr:{mode.proc_num}:node' if 'host_list' not in mode else '-host ' +
host_list=f'--host localhost:{mode.proc_num}' if 'node_num' in mode and mode.node_num == 1 else
f'--hostfile hostfile --map-by ppr:{mode.proc_num}:node' if 'host_list' not in mode else '--host ' +
','.join(f'{host}:{mode.proc_num}' for host in mode.host_list),
mca_list=' '.join(f'-mca {k} {v}' for k, v in mode.mca.items()),
mca_list=' '.join(f'--mca {k} {v}' for k, v in mode.mca.items()),
env_list=' '.join(
f'-x {k}={str(v).format(proc_rank=mode.proc_rank, proc_num=mode.proc_num)}'
if isinstance(v, str) else f'-x {k}' for k, v in mode.env.items()
Expand Down
12 changes: 6 additions & 6 deletions tests/runner/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_get_mode_command(self):
},
},
'expected_command': (
'mpirun -tag-output -allow-run-as-root -hostfile hostfile -map-by ppr:8:node -bind-to numa '
'mpirun --tag-output --allow-run-as-root --hostfile hostfile --map-by ppr:8:node --bind-to numa '
' -x PATH -x LD_LIBRARY_PATH '
f'sb exec --output-dir {self.sb_output_dir} -c sb.config.yaml -C superbench.enable=foo'
),
Expand All @@ -186,8 +186,8 @@ def test_get_mode_command(self):
},
},
'expected_command': (
'mpirun -tag-output -allow-run-as-root -hostfile hostfile -map-by ppr:8:node -bind-to numa '
'-mca coll_hcoll_enable 0 -x SB_MICRO_PATH=/sb -x FOO=BAR -x RANK=2 -x NUM=8 '
'mpirun --tag-output --allow-run-as-root --hostfile hostfile --map-by ppr:8:node --bind-to numa '
'--mca coll_hcoll_enable 0 -x SB_MICRO_PATH=/sb -x FOO=BAR -x RANK=2 -x NUM=8 '
f'sb exec --output-dir {self.sb_output_dir} -c sb.config.yaml -C superbench.enable=foo'
),
},
Expand All @@ -210,8 +210,8 @@ def test_get_mode_command(self):
},
},
'expected_command': (
'mpirun -tag-output -allow-run-as-root -host localhost:8 -bind-to numa '
'-mca coll_hcoll_enable 0 -x SB_MICRO_PATH=/sb -x FOO=BAR -x RANK=2 -x NUM=8 '
'mpirun --tag-output --allow-run-as-root --host localhost:8 --bind-to numa '
'--mca coll_hcoll_enable 0 -x SB_MICRO_PATH=/sb -x FOO=BAR -x RANK=2 -x NUM=8 '
f'sb exec --output-dir {self.sb_output_dir} -c sb.config.yaml -C superbench.enable=foo'
),
},
Expand All @@ -232,7 +232,7 @@ def test_get_mode_command(self):
},
},
'expected_command': (
'mpirun -tag-output -allow-run-as-root -host node0:8,node1:8 -bind-to numa '
'mpirun --tag-output --allow-run-as-root --host node0:8,node1:8 --bind-to numa '
' -x PATH -x LD_LIBRARY_PATH '
f'sb exec --output-dir {self.sb_output_dir} -c sb.config.yaml -C superbench.enable=foo'
),
Expand Down
Loading