Commit 74c2007f authored by Xin Zhao's avatar Xin Zhao Committed by Pavan Balaji
Browse files

Move disable_flush_local into sync struct and rename it.



Rename "disable_flush_local" to "upgrade_flush_local",
which indicates that we upgrade FLUSH_LOCAL to FLUSH.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 8a172d8b
......@@ -122,12 +122,12 @@ static inline MPIDI_RMA_Target_t *MPIDI_CH3I_Win_target_alloc(MPID_Win * win_ptr
e->lock_type = MPID_LOCK_NONE;
e->lock_mode = 0;
e->accumulated_ops_cnt = 0;
e->disable_flush_local = 0;
e->win_complete_flag = 0;
e->put_acc_issued = 0;
e->sync.sync_flag = MPIDI_RMA_SYNC_NONE;
e->sync.outstanding_acks = 0;
e->sync.upgrade_flush_local = 0;
return e;
}
......
......@@ -90,7 +90,6 @@ typedef struct MPIDI_RMA_Target {
int lock_type; /* NONE, SHARED, EXCLUSIVE */
int lock_mode; /* e.g., MODE_NO_CHECK */
int accumulated_ops_cnt;
int disable_flush_local;
int win_complete_flag;
int put_acc_issued; /* indicate if PUT/ACC is issued in this epoch
* after the previous synchronization calls. */
......@@ -108,6 +107,9 @@ typedef struct MPIDI_RMA_Target {
/* packets sent out that we are expecting an ack for */
int outstanding_acks;
/* Marked when FLUSH_LOCAL is upgraded to FLUSH */
int upgrade_flush_local;
} sync;
MPIDI_RMA_Pool_type_t pool_type;
......
......@@ -572,7 +572,7 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
/* After we do this, all following Win_flush_local
* must do a Win_flush instead. */
curr_target->disable_flush_local = 1;
curr_target->sync.upgrade_flush_local = 1;
if (curr_target->issued_read_op_list_head != NULL) {
op_list_head = &curr_target->issued_read_op_list_head;
......
......@@ -1311,7 +1311,7 @@ int MPIDI_Win_flush_local(int dest, MPID_Win * win_ptr)
}
/* Set sync_flag in sync struct. */
if (target->disable_flush_local) {
if (target->sync.upgrade_flush_local) {
if (target->sync.sync_flag < MPIDI_RMA_SYNC_FLUSH) {
target->sync.sync_flag = MPIDI_RMA_SYNC_FLUSH;
target->sync.outstanding_acks++;
......@@ -1333,8 +1333,8 @@ int MPIDI_Win_flush_local(int dest, MPID_Win * win_ptr)
&local_completed, &remote_completed);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if ((target->disable_flush_local && !remote_completed) ||
(!target->disable_flush_local && !local_completed)) {
if ((target->sync.upgrade_flush_local && !remote_completed) ||
(!target->sync.upgrade_flush_local && !local_completed)) {
mpi_errno = wait_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
......@@ -1343,13 +1343,13 @@ int MPIDI_Win_flush_local(int dest, MPID_Win * win_ptr)
* in this function call. */
progress_engine_triggered = 1;
}
} while ((target->disable_flush_local && !remote_completed) ||
(!target->disable_flush_local && !local_completed));
} while ((target->sync.upgrade_flush_local && !remote_completed) ||
(!target->sync.upgrade_flush_local && !local_completed));
finish_flush_local:
if (target != NULL) {
/* reset disable_flush_local flag in target to 0 */
target->disable_flush_local = 0;
/* reset upgrade_flush_local flag in target to 0 */
target->sync.upgrade_flush_local = 0;
/* ENDING synchronization: correctly decrement the following counters. */
win_ptr->accumulated_ops_cnt -= target->accumulated_ops_cnt;
......@@ -1735,7 +1735,7 @@ int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
int i, made_progress = 0;
int local_completed = 0, remote_completed = 0;
MPIDI_RMA_Target_t *curr_target = NULL;
int enable_flush_local_cnt = 0, disable_flush_local_cnt = 0;
int enable_flush_local_cnt = 0, upgrade_flush_local_cnt = 0;
int remote_completed_cnt = 0, local_completed_cnt = 0;
int progress_engine_triggered = 0;
int mpi_errno = MPI_SUCCESS;
......@@ -1758,12 +1758,12 @@ int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
for (i = 0; i < win_ptr->num_slots; i++) {
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
if (curr_target->disable_flush_local) {
if (curr_target->sync.upgrade_flush_local) {
if (curr_target->sync.sync_flag < MPIDI_RMA_SYNC_FLUSH) {
curr_target->sync.sync_flag = MPIDI_RMA_SYNC_FLUSH;
curr_target->sync.outstanding_acks++;
}
disable_flush_local_cnt++;
upgrade_flush_local_cnt++;
}
else {
if (curr_target->sync.sync_flag < MPIDI_RMA_SYNC_FLUSH_LOCAL) {
......@@ -1795,7 +1795,7 @@ int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (curr_target->disable_flush_local) {
if (curr_target->sync.upgrade_flush_local) {
if (remote_completed) {
remote_completed_cnt++;
}
......@@ -1809,7 +1809,7 @@ int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
}
}
if (remote_completed_cnt < disable_flush_local_cnt ||
if (remote_completed_cnt < upgrade_flush_local_cnt ||
local_completed_cnt < enable_flush_local_cnt) {
mpi_errno = wait_progress_engine();
if (mpi_errno != MPI_SUCCESS)
......@@ -1819,15 +1819,15 @@ int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
* in this function call. */
progress_engine_triggered = 1;
}
} while (remote_completed_cnt < disable_flush_local_cnt ||
} while (remote_completed_cnt < upgrade_flush_local_cnt ||
local_completed_cnt < enable_flush_local_cnt);
finish_flush_local_all:
/* reset disable_flush_local flag in target to 0 */
/* reset upgrade_flush_local flag in target to 0 */
for (i = 0; i < win_ptr->num_slots; i++) {
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
curr_target->disable_flush_local = 0;
curr_target->sync.upgrade_flush_local = 0;
curr_target = curr_target->next;
}
}
......
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