Commit f0272c38 authored by James Dinan's avatar James Dinan
Browse files

[svn-r10677] RMA State Tracking: Fence tracking and err. checks

Added an additional error check and better documentation of how the state is
tracked and updated for Fence.

Reviewer: goodell
parent 73f0dfde
......@@ -263,7 +263,11 @@ struct MPIDI_Win_target_state {
enum MPIDI_Win_epoch_states epoch_state; \
int epoch_count; \
int fence_issued; /* Indicates if fence has been called, and if an \
active target fence epoch is possible. */ \
active target fence epoch is possible. This \
is maintained separately from the epoch state;\
this state must be updated collectively (in \
fence) to ensure that the fence state across \
all processes remains consistent. */ \
int start_assert; /* assert passed to MPI_Win_start */ \
#ifdef MPIDI_CH3_WIN_DECL
......
......@@ -253,6 +253,10 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
in the window's group if any specify it */
if (assert & MPI_MODE_NOPRECEDE)
{
/* Error: Operations were issued and the user claimed NOPRECEDE */
MPIU_ERR_CHKANDJUMP(win_ptr->epoch_state == MPIDI_EPOCH_FENCE,
mpi_errno, MPI_ERR_RMA_SYNC, "**rmasync");
win_ptr->fence_issued = (assert & MPI_MODE_NOSUCCEED) ? 0 : 1;
goto fn_exit;
}
......@@ -426,14 +430,11 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
{
win_ptr->fence_issued = 0;
}
}
fn_exit:
/* Reset the epoch state if this fence completed an epoch */
if (win_ptr->epoch_state == MPIDI_EPOCH_FENCE && mpi_errno == MPI_SUCCESS) {
win_ptr->epoch_state = MPIDI_EPOCH_NONE;
}
fn_exit:
MPIU_CHKLMEM_FREEALL();
MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPIDI_WIN_FENCE);
return mpi_errno;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment