diff --git a/src/impl/mpispace/Kokkos_MPISpace.cpp b/src/impl/mpispace/Kokkos_MPISpace.cpp index 2c08d4ad..9ab04743 100644 --- a/src/impl/mpispace/Kokkos_MPISpace.cpp +++ b/src/impl/mpispace/Kokkos_MPISpace.cpp @@ -118,12 +118,6 @@ void MPISpace::deallocate(void *const, const size_t) const { MPI_Win_unlock_all(current_win); MPI_Win_free(¤t_win); - // We pass a mempory space instance do multiple Views thus - // setting "current_win = MPI_WIN_NULL;" will result in a wrong handle if - // subsequent view runs out of scope - // Fixme: The following only works when views are allocated sequentially - // We need a thread-safe map to associate views and windows - if (last_valid != 0) current_win = mpi_windows[last_valid - 1]; else diff --git a/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp b/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp index eb9cb967..70c66971 100644 --- a/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp +++ b/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp @@ -56,12 +56,10 @@ namespace Impl { assert(win != MPI_WIN_NULL); \ int _typesize; \ MPI_Type_size(mpi_type, &_typesize); \ - /*MPI_Win_lock(MPI_LOCK_SHARED, pe, 0, win); */ \ MPI_Put(&val, 1, mpi_type, pe, \ sizeof(SharedAllocationHeader) + offset * _typesize, 1, mpi_type, \ win); \ - /* MPI_Win_unlock(pe, win); */ \ - MPI_Win_flush(0, win); \ + MPI_Win_flush(pe, win); \ } KOKKOS_REMOTESPACES_P(char, MPI_SIGNED_CHAR) @@ -85,12 +83,10 @@ KOKKOS_REMOTESPACES_P(double, MPI_DOUBLE) assert(win != MPI_WIN_NULL); \ int _typesize; \ MPI_Type_size(mpi_type, &_typesize); \ - /*MPI_Win_lock(MPI_LOCK_SHARED, 0, pe, win);*/ \ MPI_Get(&val, 1, mpi_type, pe, \ sizeof(SharedAllocationHeader) + offset * _typesize, 1, mpi_type, \ win); \ - /*MPI_Win_unlock(0, win);*/ \ - MPI_Win_flush(0, win); \ + MPI_Win_flush(pe, win); \ } KOKKOS_REMOTESPACES_G(char, MPI_SIGNED_CHAR)