Skip to content

Commit

Permalink
Merge pull request kokkos#90 from nicoleavans/irecv
Browse files Browse the repository at this point in the history
resolve bug with KokkosComm::irecv, add to unit testing
  • Loading branch information
cwpearson authored Jun 18, 2024
2 parents dd3c5c4 + 67c65bc commit 35929c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 deletions.
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);
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

0 comments on commit 35929c9

Please sign in to comment.