Skip to content

Commit

Permalink
[CMake] Add MPIEXEC_PREFLAGS and MPIEXEC_POSTFLAGS to examples (liboc…
Browse files Browse the repository at this point in the history
…ca#604)

This is recommended by CMake (https://cmake.org/cmake/help/latest/module/FindMPI.html#usage-of-mpiexec)
and allows some extra control for different MPI setups.
  • Loading branch information
SFrijters authored and kris-rowe committed Aug 12, 2022
1 parent 7602447 commit 5a9d31e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
macro(add_test_with_mode_and_nranks exe mode device nranks)
if (${nranks} GREATER 1)
add_test(NAME ${exe}-${mode} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${nranks} ./${exe} --verbose --device "${device}")
add_test(NAME ${exe}-${mode} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${nranks} ${MPIEXEC_PREFLAGS} ./${exe} ${MPIEXEC_POSTFLAGS} --verbose --device "${device}")
else()
add_test(NAME ${exe}-${mode} COMMAND ./${exe} --verbose --device "${device}")
endif()
Expand Down

0 comments on commit 5a9d31e

Please sign in to comment.