Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 6 additions & 27 deletions src/KokkosComm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,10 @@
#include <Kokkos_Core.hpp>

namespace KokkosComm {
using Impl::alltoall;
using Impl::irecv;
using Impl::isend;
using Impl::recv;
using Impl::send;

template <CommMode SendMode = CommMode::Default, KokkosExecutionSpace ExecSpace, KokkosView SendView>
Req isend(const ExecSpace &space, const SendView &sv, int dest, int tag, MPI_Comm comm) {
return Impl::isend<SendMode>(space, sv, dest, tag, comm);
}

template <KokkosView RecvView>
void irecv(RecvView &rv, int src, int tag, MPI_Comm comm, MPI_Request req) {
return Impl::irecv(rv, src, tag, comm, req);
}

template <CommMode SendMode = CommMode::Default, KokkosExecutionSpace ExecSpace, KokkosView SendView>
void send(const ExecSpace &space, const SendView &sv, int dest, int tag, MPI_Comm comm) {
return Impl::send<SendMode>(space, sv, dest, tag, comm);
}

template <KokkosExecutionSpace ExecSpace, KokkosView RecvView>
void recv(const ExecSpace &space, RecvView &rv, int src, int tag, MPI_Comm comm) {
return Impl::recv(space, rv, src, tag, comm);
}

template <KokkosExecutionSpace ExecSpace, KokkosView SendView, KokkosView RecvView>
void alltoall(const ExecSpace &space, const SendView &sv, const size_t sendCount, const RecvView &rv,
const size_t recvCount, MPI_Comm comm) {
return Impl::alltoall(space, sv, sendCount, rv, recvCount, comm);
}

} // namespace KokkosComm
} // namespace KokkosComm
4 changes: 2 additions & 2 deletions unit_tests/test_isendirecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void test_1d(const View1D &a) {
} else if (1 == rank) {
int src = 0;
MPI_Request req;
KokkosComm::Impl::irecv(a, src, 0, MPI_COMM_WORLD, req);
KokkosComm::irecv(a, src, 0, MPI_COMM_WORLD, req);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still a difference between isend and irecv: isend returns a request, irecv has an output parameter. Is that on purpose?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwpearson I just saw this, what is your opinion?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably have Irecv produce an output as well. I will accept this for now and open an issue against myself to implement it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#92

MPI_Wait(&req, MPI_STATUS_IGNORE);
int errs;
Kokkos::parallel_reduce(
Expand Down Expand Up @@ -87,7 +87,7 @@ void test_2d(const View2D &a) {
} else if (1 == rank) {
int src = 0;
MPI_Request req;
KokkosComm::Impl::irecv(a, src, 0, MPI_COMM_WORLD, req);
KokkosComm::irecv(a, src, 0, MPI_COMM_WORLD, req);
MPI_Wait(&req, MPI_STATUS_IGNORE);
int errs;
Kokkos::parallel_reduce(
Expand Down