Skip to content

Commit

Permalink
tests: restrict MPI-specific stuff to when MPI is enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Carl Pearson <cwpears@sandia.gov>
  • Loading branch information
cwpearson committed Dec 18, 2024
1 parent 11789c7 commit f3ba011
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 27 deletions.
76 changes: 49 additions & 27 deletions unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,55 @@ if(KOKKOSCOMM_ENABLE_MPI)
COMMAND
${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./test-mpi
)

# MPI-specific Kokkos Comm tests
add_executable(test-main-mpi)
target_sources(
test-main-mpi
PRIVATE
mpi/test_main.cpp
mpi/test_gtest_mpi.cpp
mpi/test_sendrecv.cpp
mpi/test_allgather.cpp
mpi/test_alltoall.cpp
mpi/test_isendrecv.cpp
mpi/test_alltoall.cpp
mpi/test_reduce.cpp
mpi/test_allgather.cpp
)
target_link_libraries(
test-main-mpi
PRIVATE
KokkosComm::KokkosComm
gtest
)
add_test(
NAME test-main-mpi
COMMAND
${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./test-main-mpi
)

# General Kokkos Comm tests
add_executable(test-main)
target_sources(
test-main
PRIVATE
mpi/test_main.cpp
test_barrier.cpp
test_sendrecv.cpp
)
target_link_libraries(
test-main
PRIVATE
KokkosComm::KokkosComm
gtest
)
add_test(
NAME test-main
COMMAND
${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./test-main
)

endif()

if(KOKKOSCOMM_ENABLE_NCCL)
Expand All @@ -84,30 +133,3 @@ if(KOKKOSCOMM_ENABLE_NCCL)
COMMAND ./test-nccl
)
endif()

# Tests using the MPI communication space, but not linking with MPI itself
add_executable(test-main)
target_sources(
test-main
PRIVATE
test_main.cpp
mpi/test_gtest_mpi.cpp
mpi/test_sendrecv.cpp
mpi/test_allgather.cpp
mpi/test_alltoall.cpp
mpi/test_isendrecv.cpp
mpi/test_alltoall.cpp
mpi/test_reduce.cpp
mpi/test_allgather.cpp
)
target_link_libraries(
test-main
PRIVATE
KokkosComm::KokkosComm
gtest
)
add_test(
NAME test-main
COMMAND
${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./test-main
)
File renamed without changes.

0 comments on commit f3ba011

Please sign in to comment.