Skip to content

Commit f0c3617

Browse files
authored
Modify Templating to Work with Omniperf and Rocprof (#421)
Co-authored-by: Ben Wilfong <[email protected]>
1 parent b0bf8c7 commit f0c3617

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

toolchain/mfc/run/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import re, os, sys, typing, dataclasses
1+
import re, os, sys, typing, dataclasses, shlex
22

33
from glob import glob
44

@@ -102,7 +102,7 @@ def __generate_job_script(targets, case: input.MFCInputFile):
102102
case=case,
103103
MFC_ROOTDIR=MFC_ROOTDIR,
104104
qsystem=queues.get_system(),
105-
profiler=__profiler_prepend(),
105+
profiler=shlex.join(__profiler_prepend())
106106
)
107107

108108
file_write(__job_script_filepath(), content)

toolchain/templates/bridges2.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ echo
3939
${helpers.run_prologue(target)}
4040

4141
% if not mpi:
42-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath(case)}")
42+
(set -x; ${profiler} "${target.get_install_binpath(case)}")
4343
% else:
44-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
44+
(set -x; ${profiler} \
4545
mpirun -np ${nodes*tasks_per_node} \
4646
${' '.join([f"'{x}'" for x in ARG('--') ])} \
4747
"${target.get_install_binpath(case)}")

toolchain/templates/default.mako

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@ warn "Consider using a different template via the $MAGENTA--computer$COLOR_RESET
3333
${helpers.run_prologue(target)}
3434

3535
% if not mpi:
36-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath(case)}")
36+
(set -x; ${profiler} "${target.get_install_binpath(case)}")
3737
% else:
3838
if [ "$binary" == "jsrun" ]; then
39-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
39+
(set -x; ${profiler} \
4040
jsrun --nrs ${tasks_per_node*nodes} \
4141
--cpu_per_rs 1 \
4242
--gpu_per_rs ${1 if gpu else 0} \
4343
--tasks_per_rs 1 \
4444
${' '.join([f"'{x}'" for x in ARG('--') ])} \
4545
"${target.get_install_binpath(case)}")
4646
elif [ "$binary" == "srun" ]; then
47-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
47+
(set -x; {profiler} \
4848
srun --ntasks-per-node ${tasks_per_node} \
4949
${' '.join([f"'{x}'" for x in ARG('--') ])} \
5050
"${target.get_install_binpath(case)}")
5151
elif [ "$binary" == "mpirun" ]; then
52-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
52+
(set -x; ${profiler} \
5353
$binary -np ${nodes*tasks_per_node} \
5454
${' '.join([f"'{x}'" for x in ARG('--') ])} \
5555
"${target.get_install_binpath(case)}")
5656
elif [ "$binary" == "mpiexec" ]; then
57-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
57+
(set -x; ${profiler} \
5858
$binary --ntasks ${nodes*tasks_per_node} \
5959
${' '.join([f"'{x}'" for x in ARG('--') ])} \
6060
"${target.get_install_binpath(case)}")

toolchain/templates/delta.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sw/spack/deltas11-2023-03/apps/linux-rh
4343
${helpers.run_prologue(target)}
4444

4545
% if not mpi:
46-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath(case)}")
46+
(set -x; ${profiler} "${target.get_install_binpath(case)}")
4747
% else:
48-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
48+
(set -x; ${profiler} \
4949
mpirun -np ${nodes*tasks_per_node} \
5050
${' '.join([f"'{x}'" for x in ARG('--') ])} \
5151
"${target.get_install_binpath(case)}")

toolchain/templates/frontier.mako

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ echo
3737
${helpers.run_prologue(target)}
3838

3939
% if not mpi:
40-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath(case)}")
40+
(set -x; ${profiler} "${target.get_install_binpath(case)}")
4141
% else:
42-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
43-
srun -N ${nodes} \
42+
(set -x; srun -N ${nodes} \
4443
-n ${tasks_per_node} \
44+
${profiler} \
4545
${' '.join([f"'{x}'" for x in ARG('--') ])} \
4646
"${target.get_install_binpath(case)}")
4747
% endif

toolchain/templates/phoenix.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ echo
3939
${helpers.run_prologue(target)}
4040

4141
% if not mpi:
42-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath(case)}")
42+
(set -x; ${profiler} "${target.get_install_binpath(case)}")
4343
% else:
44-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
44+
(set -x; ${profiler} \
4545
mpirun -np ${nodes*tasks_per_node} \
4646
--bind-to none \
4747
${' '.join([f"'{x}'" for x in ARG('--') ])} \

toolchain/templates/summit.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ echo
2424
${helpers.run_prologue(target)}
2525

2626
% if not mpi:
27-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath(case)}")
27+
(set -x; ${rofiler} "${target.get_install_binpath(case)}")
2828
% else:
29-
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
29+
(set -x; ${profiler} \
3030
jsrun \
3131
${'--smpiargs="-gpu"' if gpu else ''} \
3232
--nrs ${tasks_per_node*nodes} \

0 commit comments

Comments
 (0)