Skip to content

Commit

Permalink
mvapich mpiexec flags & Print invocation (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryleberre authored Feb 24, 2024
1 parent d15f9fa commit 64e514c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 21 deletions.
6 changes: 3 additions & 3 deletions toolchain/templates/bridges2.mako
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ echo
${helpers.run_prologue(target)}

% if not mpi:
${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}"
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}")
% else:
${' '.join([f"'{x}'" for x in profiler ])} \
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
mpirun -np ${nodes*tasks_per_node} \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}"
"${target.get_install_binpath()}")
% endif

${helpers.run_epilogue(target)}
Expand Down
21 changes: 13 additions & 8 deletions toolchain/templates/default.mako
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,31 @@ warn "Consider using a different template via the $MAGENTA--computer$COLOR_RESET
${helpers.run_prologue(target)}

% if not mpi:
${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}"
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}")
% else:
if [ "$binary" == "jsrun" ]; then
${' '.join([f"'{x}'" for x in profiler ])} \
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
jsrun --nrs ${tasks_per_node*nodes} \
--cpu_per_rs 1 \
--gpu_per_rs ${1 if gpu else 0} \
--tasks_per_rs 1 \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}"
"${target.get_install_binpath()}")
elif [ "$binary" == "srun" ]; then
${' '.join([f"'{x}'" for x in profiler ])} \
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
srun --ntasks-per-node ${tasks_per_node} \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}"
elif [ "$binary" == "mpirun" ] || [ "$binary" == "mpiexec" ]; then
${' '.join([f"'{x}'" for x in profiler ])} \
"${target.get_install_binpath()}")
elif [ "$binary" == "mpirun" ]; then
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
$binary -np ${nodes*tasks_per_node} \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}"
"${target.get_install_binpath()}")
elif [ "$binary" == "mpiexec" ]; then
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
$binary --ntasks ${nodes*tasks_per_node} \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}")
fi
% endif

Expand Down
8 changes: 4 additions & 4 deletions toolchain/templates/delta.mako
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sw/spack/deltas11-2023-03/apps/linux-rh
${helpers.run_prologue(target)}

% if not mpi:
${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}"
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}")
% else:
${' '.join([f"'{x}'" for x in profiler ])} \
mpirun -np ${nodes*tasks_per_node} \
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
mpirun -np ${nodes*tasks_per_node} \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}"
"${target.get_install_binpath()}")
% endif

${helpers.run_epilogue(target)}
Expand Down
6 changes: 3 additions & 3 deletions toolchain/templates/phoenix.mako
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ echo
${helpers.run_prologue(target)}

% if not mpi:
${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}"
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}")
% else:
${' '.join([f"'{x}'" for x in profiler ])} \
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
mpirun -np ${nodes*tasks_per_node} \
--bind-to none \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}"
"${target.get_install_binpath()}")
% endif

${helpers.run_epilogue(target)}
Expand Down
6 changes: 3 additions & 3 deletions toolchain/templates/summit.mako
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ echo
${helpers.run_prologue(target)}

% if not mpi:
${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}"
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}")
% else:
${' '.join([f"'{x}'" for x in profiler ])} \
(set -x; ${' '.join([f"'{x}'" for x in profiler ])} \
jsrun \
${'--smpiargs="-gpu"' if gpu else ''} \
--nrs ${tasks_per_node*nodes} \
--cpu_per_rs 1 \
--gpu_per_rs ${1 if gpu else 0} \
--tasks_per_rs 1 \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}"
"${target.get_install_binpath()}")
% endif

${helpers.run_epilogue(target)}
Expand Down

0 comments on commit 64e514c

Please sign in to comment.