2424
2525namespace KokkosComm ::mpi {
2626
27- template <CommunicationMode SendMode, KokkosView SendView >
28- void send (const SendMode &, const SendView &sv, int dest, int tag, MPI_Comm comm) {
27+ template <KokkosView SendView, CommunicationMode SendMode >
28+ void send (const SendView &sv, int dest, int tag, MPI_Comm comm, SendMode ) {
2929 Kokkos::Tools::pushRegion (" KokkosComm::Impl::send" );
3030 using KCT = typename KokkosComm::Traits<SendView>;
3131
3232 auto mpi_send_fn = [](void *mpi_view, int mpi_count, MPI_Datatype mpi_datatype, int mpi_dest, int mpi_tag,
3333 MPI_Comm mpi_comm) {
34- if constexpr (std::is_same_v<SendMode, StandardCommMode >) {
34+ if constexpr (std::is_same_v<SendMode, CommModeStandard >) {
3535 MPI_Send (mpi_view, mpi_count, mpi_datatype, mpi_dest, mpi_tag, mpi_comm);
36- } else if constexpr (std::is_same_v<SendMode, ReadyCommMode >) {
36+ } else if constexpr (std::is_same_v<SendMode, CommModeReady >) {
3737 MPI_Rsend (mpi_view, mpi_count, mpi_datatype, mpi_dest, mpi_tag, mpi_comm);
38- } else if constexpr (std::is_same_v<SendMode, SynchronousCommMode >) {
38+ } else if constexpr (std::is_same_v<SendMode, CommModeSynchronous >) {
3939 MPI_Ssend (mpi_view, mpi_count, mpi_datatype, mpi_dest, mpi_tag, mpi_comm);
40+ } else {
41+ static_assert (std::is_void_v<SendMode>, " unexpected communication mode" );
4042 }
4143 };
4244
@@ -50,33 +52,22 @@ void send(const SendMode &, const SendView &sv, int dest, int tag, MPI_Comm comm
5052 Kokkos::Tools::popRegion ();
5153}
5254
53- <<<<<<< HEAD
54- template <KokkosView SendView>
55- void send (const SendView &sv, int dest, int tag, MPI_Comm comm) {
56- send (KokkosComm::DefaultCommMode (), sv, dest, tag, comm);
57- }
58-
59- template <CommunicationMode SendMode, KokkosExecutionSpace ExecSpace, KokkosView SendView>
60- void send (const SendMode &, const ExecSpace &space, const SendView &sv, int dest, int tag, MPI_Comm comm) {
61- =======
6255template <KokkosExecutionSpace ExecSpace, KokkosView SendView, CommunicationMode SendMode>
6356void send (const ExecSpace &space, const SendView &sv, int dest, int tag, MPI_Comm comm, SendMode) {
64- >>>>>>> 58bcb64 (Communication mode rework)
6557 Kokkos::Tools::pushRegion (" KokkosComm::Impl::send" );
6658
6759 using Packer = typename KokkosComm::PackTraits<SendView>::packer_type;
6860
6961 auto mpi_send_fn = [](void *mpi_view, int mpi_count, MPI_Datatype mpi_datatype, int mpi_dest, int mpi_tag,
7062 MPI_Comm mpi_comm) {
71-
7263 if constexpr (std::is_same_v<SendMode, CommModeStandard>) {
7364 MPI_Send (mpi_view, mpi_count, mpi_datatype, mpi_dest, mpi_tag, mpi_comm);
7465 } else if constexpr (std::is_same_v<SendMode, CommModeReady>) {
7566 MPI_Rsend (mpi_view, mpi_count, mpi_datatype, mpi_dest, mpi_tag, mpi_comm);
7667 } else if constexpr (std::is_same_v<SendMode, CommModeSynchronous>) {
7768 MPI_Ssend (mpi_view, mpi_count, mpi_datatype, mpi_dest, mpi_tag, mpi_comm);
7869 } else {
79- static_assert (std::is_void_v<SendMode>, " Unexpected Communication Mode " );
70+ static_assert (std::is_void_v<SendMode>, " unexpected communication mode " );
8071 }
8172 };
8273
0 commit comments