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

[svn-r10590] Renamed fence_cnt to fence_issued

The fence_cnt field in MPID_Win is not a counter, it's a flag that indicates if
fence has been called.

Reviewer: buntinas
parent 313a1d25
......@@ -1651,8 +1651,8 @@ typedef struct MPID_RMA_Ops {
S*/
typedef struct MPID_Win {
MPIU_OBJECT_HEADER; /* adds handle and ref_count fields */
int fence_cnt; /* 0 = no fence has been called;
1 = fence has been called */
int fence_issued; /* Indicates if fence has been called, and if an
active target fence epoch is possible. */
MPID_Errhandler *errhandler; /* Pointer to the error handler structure */
void *base;
MPI_Aint size;
......
......@@ -37,7 +37,7 @@ int MPIDI_Get_accumulate(const void *origin_addr, int origin_count,
goto fn_exit;
}
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_cnt) {
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_issued) {
win_ptr->epoch_state = MPIDI_EPOCH_FENCE;
}
......@@ -243,7 +243,7 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
goto fn_exit;
}
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_cnt) {
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_issued) {
win_ptr->epoch_state = MPIDI_EPOCH_FENCE;
}
......@@ -324,7 +324,7 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
goto fn_exit;
}
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_cnt) {
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_issued) {
win_ptr->epoch_state = MPIDI_EPOCH_FENCE;
}
......
......@@ -132,7 +132,7 @@ int MPIDI_Put(const void *origin_addr, int origin_count, MPI_Datatype
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_PUT);
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_cnt) {
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_issued) {
win_ptr->epoch_state = MPIDI_EPOCH_FENCE;
}
......@@ -227,7 +227,7 @@ int MPIDI_Get(void *origin_addr, int origin_count, MPI_Datatype
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_GET);
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_cnt) {
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_issued) {
win_ptr->epoch_state = MPIDI_EPOCH_FENCE;
}
......@@ -323,7 +323,7 @@ int MPIDI_Accumulate(const void *origin_addr, int origin_count, MPI_Datatype
MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_ACCUMULATE);
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_cnt) {
if (win_ptr->epoch_state == MPIDI_EPOCH_NONE && win_ptr->fence_issued) {
win_ptr->epoch_state = MPIDI_EPOCH_FENCE;
}
......
......@@ -253,20 +253,20 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
in the window's group if any specify it */
if (assert & MPI_MODE_NOPRECEDE)
{
win_ptr->fence_cnt = (assert & MPI_MODE_NOSUCCEED) ? 0 : 1;
win_ptr->fence_issued = (assert & MPI_MODE_NOSUCCEED) ? 0 : 1;
goto fn_exit;
}
if (win_ptr->fence_cnt == 0)
if (win_ptr->fence_issued == 0)
{
/* win_ptr->fence_cnt == 0 means either this is the very first
/* win_ptr->fence_issued == 0 means either this is the very first
call to fence or the preceding fence had the
MPI_MODE_NOSUCCEED assert.
If this fence has MPI_MODE_NOSUCCEED, do nothing and return.
Otherwise just increment the fence count and return. */
if (!(assert & MPI_MODE_NOSUCCEED)) win_ptr->fence_cnt = 1;
if (!(assert & MPI_MODE_NOSUCCEED)) win_ptr->fence_issued = 1;
}
else
{
......@@ -427,7 +427,7 @@ int MPIDI_Win_fence(int assert, MPID_Win *win_ptr)
if (assert & MPI_MODE_NOSUCCEED)
{
win_ptr->fence_cnt = 0;
win_ptr->fence_issued = 0;
}
}
......@@ -1286,7 +1286,7 @@ int MPIDI_Win_post(MPID_Group *post_grp_ptr, int assert, MPID_Win *win_ptr)
/* Even though we would want to reset the fence counter to keep
* the user from using the previous fence to mark the beginning of
* a fence epoch if he switched from fence to lock-unlock
* synchronization, we cannot do this because fence_cnt must be
* synchronization, we cannot do this because fence_issued must be
* updated collectively */
/* In case this process was previously the target of passive target rma
......@@ -1436,7 +1436,7 @@ int MPIDI_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr)
/* Even though we would want to reset the fence counter to keep
* the user from using the previous fence to mark the beginning of
* a fence epoch if he switched from fence to lock-unlock
* synchronization, we cannot do this because fence_cnt must be
* synchronization, we cannot do this because fence_issued must be
* updated collectively */
/* In case this process was previously the target of passive target rma
......@@ -1857,7 +1857,7 @@ int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr)
/* Even though we would want to reset the fence counter to keep
* the user from using the previous fence to mark the beginning of
* a fence epoch if he switched from fence to lock-unlock
* synchronization, we cannot do this because fence_cnt must be
* synchronization, we cannot do this because fence_issued must be
* updated collectively */
if (dest == MPI_PROC_NULL) goto fn_exit;
......
......@@ -255,7 +255,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
MPIU_Object_set_ref(*win_ptr, 1);
(*win_ptr)->fence_cnt = 0;
(*win_ptr)->fence_issued = 0;
/* (*win_ptr)->errhandler is set by upper level; */
/* (*win_ptr)->base is set by caller; */
(*win_ptr)->size = size;
......
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