diff --git a/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp b/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp index eb9cb967..fd2e7604 100644 --- a/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp +++ b/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp @@ -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) @@ -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)