Skip to content

Commit

Permalink
adding custom mpirun params cmake var (#604)
Browse files Browse the repository at this point in the history
* adding custom mpirun params cmake var

* minor change
  • Loading branch information
nirandaperera authored Aug 19, 2022
1 parent f20c119 commit d99a6f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,17 @@ if (CYLON_CUSTOM_MPIRUN)
endif (CYLON_CUSTOM_MPIRUN)
message(STATUS "MPI executable: ${MPIEXEC_EXECUTABLE}")

if (CYLON_CUSTOM_MPIRUN_PARAMS)
set(MPIEXEC_EXECUTABLE_PARAMS ${CYLON_CUSTOM_MPIRUN_PARAMS})
else ()
if (WIN32)
set(MPIEXEC_EXECUTABLE_PARAMS "")
else ()
set(MPIEXEC_EXECUTABLE_PARAMS --allow-run-as-root --oversubscribe)
endif ()
endif (CYLON_CUSTOM_MPIRUN_PARAMS)
message(STATUS "MPI executable params: ${MPIEXEC_EXECUTABLE_PARAMS}")

include_directories(SYSTEM ${MPI_CXX_INCLUDE_PATH})

# Glog
Expand Down
6 changes: 3 additions & 3 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ endfunction(cylon_add_test)
function(cylon_run_test TESTNAME parallelism comm_args)
set(exec_name "${TESTNAME}_${parallelism}_${comm_args}")
if (WIN32)
set(test_params -np ${parallelism} "${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/${TESTNAME}" --comm "${comm_args}")
set(test_params -n ${parallelism} "${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/${TESTNAME}" --comm "${comm_args}")
else ()
set(test_params --allow-run-as-root --oversubscribe -np ${parallelism} "${CMAKE_BINARY_DIR}/bin/${TESTNAME}" --comm "${comm_args}")
set(test_params -n ${parallelism} "${CMAKE_BINARY_DIR}/bin/${TESTNAME}" --comm "${comm_args}")
endif ()
add_test(NAME ${exec_name} COMMAND ${MPIEXEC_EXECUTABLE} ${test_params})
add_test(NAME ${exec_name} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_EXECUTABLE_PARAMS} ${test_params})
endfunction(cylon_run_test)

#Add tests as follows ...
Expand Down

0 comments on commit d99a6f2

Please sign in to comment.