From 5bd4123cee1235063e7df891e06b80a02e0ca5bd Mon Sep 17 00:00:00 2001 From: Jan Ciesko Date: Wed, 3 Aug 2022 15:44:33 -0600 Subject: [PATCH] Remove use of MPI_Win_lock/unlock from MPI Ops --- src/impl/mpispace/Kokkos_MPISpace.cpp | 6 ------ src/impl/mpispace/Kokkos_MPISpace_Ops.hpp | 4 ---- 2 files changed, 10 deletions(-) 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 d8fec704..70c66971 100644 --- a/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp +++ b/src/impl/mpispace/Kokkos_MPISpace_Ops.hpp @@ -56,11 +56,9 @@ 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(pe, win); \ } @@ -85,11 +83,9 @@ 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, pe, 0, win); \ MPI_Get(&val, 1, mpi_type, pe, \ sizeof(SharedAllocationHeader) + offset * _typesize, 1, mpi_type, \ win); \ - MPI_Win_unlock(pe, win); \ MPI_Win_flush(pe, win); \ }