Skip to content

Commit

Permalink
use request-based RMA sync
Browse files Browse the repository at this point in the history
correct fix for kokkos#51

related to https://www.mail-archive.com/[email protected]/msg30676.html

Signed-off-by: Jeff Hammond <[email protected]>
  • Loading branch information
jeffhammond committed Aug 3, 2022
1 parent 7ca76e0 commit 4974153
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/impl/mpispace/Kokkos_MPISpace_Ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ namespace Impl {
const type val, const size_t offset, const int pe, const MPI_Win &win) { \
assert(win != MPI_WIN_NULL); \
int _typesize; \
MPI_Request request; \
MPI_Type_size(mpi_type, &_typesize); \
/*MPI_Win_lock(MPI_LOCK_SHARED, pe, 0, win); */ \
MPI_Put(&val, 1, mpi_type, pe, \
MPI_Rput(&val, 1, mpi_type, pe, \
sizeof(SharedAllocationHeader) + offset * _typesize, 1, mpi_type, \
win); \
/* MPI_Win_unlock(pe, win); */ \
MPI_Win_flush(0, win); \
win, &request); \
MPI_Wait(&request, MPI_STATUS_IGNORE); \
}

KOKKOS_REMOTESPACES_P(char, MPI_SIGNED_CHAR)
Expand All @@ -84,13 +83,12 @@ KOKKOS_REMOTESPACES_P(double, MPI_DOUBLE)
type &val, const size_t offset, const int pe, const MPI_Win &win) { \
assert(win != MPI_WIN_NULL); \
int _typesize; \
MPI_Request request; \
MPI_Type_size(mpi_type, &_typesize); \
/*MPI_Win_lock(MPI_LOCK_SHARED, 0, pe, win);*/ \
MPI_Get(&val, 1, mpi_type, pe, \
MPI_Rget(&val, 1, mpi_type, pe, \
sizeof(SharedAllocationHeader) + offset * _typesize, 1, mpi_type, \
win); \
/*MPI_Win_unlock(0, win);*/ \
MPI_Win_flush(0, win); \
win, &request); \
MPI_Wait(&request, MPI_STATUS_IGNORE); \
}

KOKKOS_REMOTESPACES_G(char, MPI_SIGNED_CHAR)
Expand Down

0 comments on commit 4974153

Please sign in to comment.