diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index e86674a1..ae22a262 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -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) @@ -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 -) diff --git a/unit_tests/test_main.cpp b/unit_tests/mpi/test_main.cpp similarity index 100% rename from unit_tests/test_main.cpp rename to unit_tests/mpi/test_main.cpp