Skip to content

Commit

Permalink
mpi: contiguous low-level send
Browse files Browse the repository at this point in the history
  • Loading branch information
cwpearson committed May 13, 2024
1 parent 7d76fa5 commit ec6ccc5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/impl/KokkosComm_send.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@

namespace KokkosComm::Impl {

template <KokkosView SendView>
void send(const SendView &sv, int dest, int tag, MPI_Comm comm) {
using KCT = typename KokkosComm::Traits<SendView>;

if (KCT::is_contiguous(sv)) {
using SendScalar = typename SendView::non_const_value_type;
MPI_Send(KCT::data_handle(sv), KCT::span(sv), mpi_type_v<SendScalar>, dest, tag, comm);
} else {
throw std::runtime_error("only contiguous views supported for low-level send");
}
}

template <CommMode SendMode = CommMode::Default, KokkosExecutionSpace ExecSpace, KokkosView SendView>
void send(const ExecSpace &space, const SendView &sv, int dest, int tag, MPI_Comm comm) {
Kokkos::Tools::pushRegion("KokkosComm::Impl::send");
Expand Down

0 comments on commit ec6ccc5

Please sign in to comment.