Skip to content

Commit

Permalink
Make sure that Kokkos is initialized on all ranks in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
janciesko committed May 8, 2024
1 parent d30b3fd commit 467e8c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions unit_tests/Test_Empty.cpp
Expand Up @@ -23,7 +23,4 @@ using RemoteSpace_t = Kokkos::Experimental::DefaultRemoteMemorySpace;

void test_empty() { RemoteSpace_t::fence(); }

TEST(TEST_CATEGORY, test_empty) {
test_empty();
MPI_Barrier(MPI_COMM_WORLD);
}
TEST(TEST_CATEGORY, test_empty) { test_empty(); }
3 changes: 3 additions & 0 deletions unit_tests/Test_Main.cpp
Expand Up @@ -21,6 +21,8 @@

#include <Kokkos_RemoteSpaces.hpp>

using RemoteSpace_t = Kokkos::Experimental::DefaultRemoteMemorySpace;

int main(int argc, char *argv[]) {
int mpi_thread_level_available;
int mpi_thread_level_required = MPI_THREAD_MULTIPLE;
Expand Down Expand Up @@ -54,6 +56,7 @@ int main(int argc, char *argv[]) {

Kokkos::initialize(argc, argv);
::testing::InitGoogleTest(&argc, argv);
RemoteSpace_t::fence();
int result = RUN_ALL_TESTS();

Kokkos::finalize();
Expand Down

0 comments on commit 467e8c0

Please sign in to comment.