diff --git a/src/KokkosComm.hpp b/src/KokkosComm.hpp index a34f1d0c..f2bd36aa 100644 --- a/src/KokkosComm.hpp +++ b/src/KokkosComm.hpp @@ -27,9 +27,6 @@ namespace KokkosComm { -template - KokkosView SendView> // Scoped enumeration to specify the communication mode of a sending operation. // See section 3.4 of the MPI standard for a complete specification. enum class CommMode : uint8_t { @@ -48,27 +45,28 @@ enum class CommMode : uint8_t { Synchronous, }; +template Req isend(const ExecSpace &space, const SendView &sv, int dest, int tag, MPI_Comm comm) { - if constexpr (CommMode == Mode::Default) { + if constexpr (SendMode == CommMode::Standard) { return Impl::isend(space, sv, dest, tag, comm); - } else if constexpr (CommMode == Mode::Ready) { + } else if constexpr (SendMode == CommMode::Ready) { return Impl::irsend(space, sv, dest, tag, comm); - } else if constexpr (CommMode == Mode::Synchronous) { + } else if constexpr (SendMode == CommMode::Synchronous) { return Impl::issend(space, sv, dest, tag, comm); } } -template - KokkosView SendView> +template void send(const ExecSpace &space, const SendView &sv, int dest, int tag, MPI_Comm comm) { - if constexpr (CommMode == Mode::Default) { + if constexpr (SendMode == CommMode::Standard) { return Impl::send(space, sv, dest, tag, comm); - } else if constexpr (CommMode == Mode::Ready) { + } else if constexpr (SendMode == CommMode::Ready) { return Impl::rsend(space, sv, dest, tag, comm); - } else if constexpr (CommMode == Mode::Synchronous) { + } else if constexpr (SendMode == CommMode::Synchronous) { return Impl::ssend(space, sv, dest, tag, comm); } } diff --git a/unit_tests/test_irsendrecv.cpp b/unit_tests/test_irsendrecv.cpp index 854a25d7..6a5ce8b2 100644 --- a/unit_tests/test_irsendrecv.cpp +++ b/unit_tests/test_irsendrecv.cpp @@ -43,7 +43,7 @@ TYPED_TEST(IrsendRecv, 1D_contig) { int dst = 1; Kokkos::parallel_for( a.extent(0), KOKKOS_LAMBDA(const int i) { a(i) = i; }); - KokkosComm::Req req = KokkosComm::isend( + KokkosComm::Req req = KokkosComm::isend( Kokkos::DefaultExecutionSpace(), a, dst, 0, MPI_COMM_WORLD); req.wait(); } else if (1 == rank) { @@ -75,7 +75,7 @@ TYPED_TEST(IrsendRecv, 1D_noncontig) { int dst = 1; Kokkos::parallel_for( a.extent(0), KOKKOS_LAMBDA(const int i) { a(i) = i; }); - KokkosComm::Req req = KokkosComm::isend( + KokkosComm::Req req = KokkosComm::isend( Kokkos::DefaultExecutionSpace(), a, dst, 0, MPI_COMM_WORLD); req.wait(); } else if (1 == rank) { diff --git a/unit_tests/test_issendrecv.cpp b/unit_tests/test_issendrecv.cpp index 1e00c12f..1f668bfb 100644 --- a/unit_tests/test_issendrecv.cpp +++ b/unit_tests/test_issendrecv.cpp @@ -43,7 +43,7 @@ TYPED_TEST(IssendRecv, 1D_contig) { int dst = 1; Kokkos::parallel_for( a.extent(0), KOKKOS_LAMBDA(const int i) { a(i) = i; }); - KokkosComm::Req req = KokkosComm::isend( + KokkosComm::Req req = KokkosComm::isend( Kokkos::DefaultExecutionSpace(), a, dst, 0, MPI_COMM_WORLD); req.wait(); } else if (1 == rank) { @@ -75,7 +75,7 @@ TYPED_TEST(IssendRecv, 1D_noncontig) { int dst = 1; Kokkos::parallel_for( a.extent(0), KOKKOS_LAMBDA(const int i) { a(i) = i; }); - KokkosComm::Req req = KokkosComm::isend( + KokkosComm::Req req = KokkosComm::isend( Kokkos::DefaultExecutionSpace(), a, dst, 0, MPI_COMM_WORLD); req.wait(); } else if (1 == rank) { diff --git a/unit_tests/test_rsendrecv.cpp b/unit_tests/test_rsendrecv.cpp index 99bc5482..a2f82695 100644 --- a/unit_tests/test_rsendrecv.cpp +++ b/unit_tests/test_rsendrecv.cpp @@ -43,8 +43,8 @@ TYPED_TEST(RsendRecv, 1D_contig) { int dst = 1; Kokkos::parallel_for( a.extent(0), KOKKOS_LAMBDA(const int i) { a(i) = i; }); - KokkosComm::send(Kokkos::DefaultExecutionSpace(), - a, dst, 0, MPI_COMM_WORLD); + KokkosComm::send( + Kokkos::DefaultExecutionSpace(), a, dst, 0, MPI_COMM_WORLD); } else if (1 == rank) { int src = 0; KokkosComm::recv(Kokkos::DefaultExecutionSpace(), a, src, 0, @@ -71,8 +71,8 @@ TYPED_TEST(RsendRecv, 1D_noncontig) { int dst = 1; Kokkos::parallel_for( a.extent(0), KOKKOS_LAMBDA(const int i) { a(i) = i; }); - KokkosComm::send(Kokkos::DefaultExecutionSpace(), - a, dst, 0, MPI_COMM_WORLD); + KokkosComm::send( + Kokkos::DefaultExecutionSpace(), a, dst, 0, MPI_COMM_WORLD); } else if (1 == rank) { int src = 0; KokkosComm::recv(Kokkos::DefaultExecutionSpace(), a, src, 0, diff --git a/unit_tests/test_ssendrecv.cpp b/unit_tests/test_ssendrecv.cpp index 93f3981a..5e905498 100644 --- a/unit_tests/test_ssendrecv.cpp +++ b/unit_tests/test_ssendrecv.cpp @@ -43,7 +43,7 @@ TYPED_TEST(SsendRecv, 1D_contig) { int dst = 1; Kokkos::parallel_for( a.extent(0), KOKKOS_LAMBDA(const int i) { a(i) = i; }); - KokkosComm::send( + KokkosComm::send( Kokkos::DefaultExecutionSpace(), a, dst, 0, MPI_COMM_WORLD); } else if (1 == rank) { int src = 0; @@ -71,7 +71,7 @@ TYPED_TEST(SsendRecv, 1D_noncontig) { int dst = 1; Kokkos::parallel_for( a.extent(0), KOKKOS_LAMBDA(const int i) { a(i) = i; }); - KokkosComm::send( + KokkosComm::send( Kokkos::DefaultExecutionSpace(), a, dst, 0, MPI_COMM_WORLD); } else if (1 == rank) { int src = 0;