Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MPI implementation detection if multiple MPIs are installed #144

Merged
merged 2 commits into from
Feb 19, 2025
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
4 changes: 4 additions & 0 deletions cmake/Config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

@PACKAGE_INIT@

set(KOKKOSCOMM_ENABLE_MPI "@KOKKOSCOMM_ENABLE_MPI@")
set(KOKKOSCOMM_IMPL_MPI_IS_MPICH "@KOKKOSCOMM_IMPL_MPI_IS_MPICH@")
set(KOKKOSCOMM_IMPL_MPI_IS_OPENMPI "@KOKKOSCOMM_IMPL_MPI_IS_OPENMPI@")

GET_FILENAME_COMPONENT(KokkosComm_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

include(CMakeFindDependencyMacro)
Expand Down
6 changes: 3 additions & 3 deletions cmake/mpi-vendor.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function(kokkoscomm_set_mpi_vendor_variables)
# Get the directory of the MPI executable
get_filename_component(MPIEXEC_DIR ${MPIEXEC_EXECUTABLE} DIRECTORY)

# Check for mpichversion
find_program(MPICHVERSION_EXECUTABLE mpichversion HINTS ${MPIEXEC_DIR})
find_program(OMPI_INFO_EXECUTABLE ompi_info HINTS ${MPIEXEC_DIR})
# Check for mpichversion and ompi_info
find_program(MPICHVERSION_EXECUTABLE mpichversion HINTS ${MPIEXEC_DIR} NO_DEFAULT_PATH)
find_program(OMPI_INFO_EXECUTABLE ompi_info HINTS ${MPIEXEC_DIR} NO_DEFAULT_PATH)

if (MPICHVERSION_EXECUTABLE AND OPENMPI_INFO_EXECUTABLE)
message(WARNING "Both MPICHVERSION_EXECUTABLE and OMPI_INFO_EXECUTABLE are set - unable to determine MPI vendor")
Expand Down
Loading