Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpi: contiguous send wrapper #56

Merged
merged 2 commits into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/impl/KokkosComm_send.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@

namespace KokkosComm::Impl {

template <KokkosView SendView>
void send(const SendView &sv, int dest, int tag, MPI_Comm comm) {
Kokkos::Tools::pushRegion("KokkosComm::Impl::send");
using KCT = typename KokkosComm::Traits<SendView>;
cedricchevalier19 marked this conversation as resolved.
Show resolved Hide resolved

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");
}
Kokkos::Tools::popRegion();
}

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
Loading