Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Uncomment the use of MPI_Win_lock/MPI_Win_unlock #51

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/impl/mpispace/Kokkos_MPISpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,6 @@ void MPISpace::deallocate(void *const, const size_t) const {
MPI_Win_unlock_all(current_win);
MPI_Win_free(&current_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
Expand Down
8 changes: 2 additions & 6 deletions src/impl/mpispace/Kokkos_MPISpace_Ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down