Commit 2db95ef9 authored by Xin Zhao's avatar Xin Zhao Committed by Pavan Balaji
Browse files

Add "_head" to name of linked lists.


Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 299ede6e
......@@ -111,10 +111,10 @@ static inline MPIDI_RMA_Target_t *MPIDI_CH3I_Win_target_alloc(MPID_Win * win_ptr
MPL_LL_DELETE(win_ptr->target_pool, win_ptr->target_pool_tail, e);
}
e->read_op_list = e->read_op_list_tail = NULL;
e->write_op_list = e->write_op_list_tail = NULL;
e->dt_op_list = e->dt_op_list_tail = NULL;
e->pending_op_list = e->pending_op_list_tail = NULL;
e->read_op_list_head = e->read_op_list_tail = NULL;
e->write_op_list_head = e->write_op_list_tail = NULL;
e->dt_op_list_head = e->dt_op_list_tail = NULL;
e->pending_op_list_head = e->pending_op_list_tail = NULL;
e->next_op_to_issue = NULL;
e->target_rank = -1;
......@@ -145,10 +145,10 @@ static inline int MPIDI_CH3I_Win_target_free(MPID_Win * win_ptr, MPIDI_RMA_Targe
/* We enqueue elements to the right pool, so when they get freed
* at window free time, they won't conflict with the global pool
* or other windows */
MPIU_Assert(e->read_op_list == NULL);
MPIU_Assert(e->write_op_list == NULL);
MPIU_Assert(e->dt_op_list == NULL);
MPIU_Assert(e->pending_op_list == NULL);
MPIU_Assert(e->read_op_list_head == NULL);
MPIU_Assert(e->write_op_list_head == NULL);
MPIU_Assert(e->dt_op_list_head == NULL);
MPIU_Assert(e->pending_op_list_head == NULL);
/* use PREPEND when return objects back to the pool
* in order to improve cache performance */
......@@ -187,11 +187,11 @@ static inline int MPIDI_CH3I_Win_create_target(MPID_Win * win_ptr, int target_ra
t->target_rank = target_rank;
if (slot->target_list == NULL)
if (slot->target_list_head == NULL)
win_ptr->non_empty_slots++;
/* Enqueue target into target list. */
MPL_LL_APPEND(slot->target_list, slot->target_list_tail, t);
MPL_LL_APPEND(slot->target_list_head, slot->target_list_tail, t);
assert(t != NULL);
......@@ -221,7 +221,7 @@ static inline int MPIDI_CH3I_Win_find_target(MPID_Win * win_ptr, int target_rank
else
slot = &(win_ptr->slots[target_rank]);
t = slot->target_list;
t = slot->target_list_head;
while (t != NULL) {
if (t->target_rank == target_rank)
break;
......@@ -277,7 +277,7 @@ static inline int MPIDI_CH3I_Win_enqueue_op(MPID_Win * win_ptr, MPIDI_RMA_Op_t *
}
/* Enqueue operation into pending list. */
MPL_LL_APPEND(target->pending_op_list, target->pending_op_list_tail, op);
MPL_LL_APPEND(target->pending_op_list_head, target->pending_op_list_tail, op);
if (target->next_op_to_issue == NULL)
target->next_op_to_issue = op;
......@@ -309,13 +309,13 @@ static inline int MPIDI_CH3I_Win_target_dequeue_and_free(MPID_Win * win_ptr, MPI
else
slot = &(win_ptr->slots[target_rank]);
MPL_LL_DELETE(slot->target_list, slot->target_list_tail, e);
MPL_LL_DELETE(slot->target_list_head, slot->target_list_tail, e);
mpi_errno = MPIDI_CH3I_Win_target_free(win_ptr, e);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (slot->target_list == NULL)
if (slot->target_list_head == NULL)
win_ptr->non_empty_slots--;
fn_exit:
......@@ -333,7 +333,7 @@ static inline int MPIDI_CH3I_RMA_Cleanup_ops_target(MPID_Win * win_ptr, MPIDI_RM
int *local_completed, int *remote_completed)
{
MPIDI_RMA_Op_t *curr_op = NULL;
MPIDI_RMA_Op_t **op_list = NULL, **op_list_tail = NULL;
MPIDI_RMA_Op_t **op_list_head = NULL, **op_list_tail = NULL;
int read_flag = 0, write_flag = 0;
int mpi_errno = MPI_SUCCESS;
int i;
......@@ -353,22 +353,23 @@ static inline int MPIDI_CH3I_RMA_Cleanup_ops_target(MPID_Win * win_ptr, MPIDI_RM
target->access_state == MPIDI_RMA_LOCK_ISSUED)
goto fn_exit;
if (target->pending_op_list == NULL &&
target->read_op_list == NULL && target->write_op_list == NULL && target->dt_op_list == NULL)
if (target->pending_op_list_head == NULL &&
target->read_op_list_head == NULL && target->write_op_list_head == NULL &&
target->dt_op_list_head == NULL)
goto cleanup_target;
if (target->read_op_list != NULL) {
op_list = &(target->read_op_list);
if (target->read_op_list_head != NULL) {
op_list_head = &(target->read_op_list_head);
op_list_tail = &(target->read_op_list_tail);
read_flag = 1;
}
else if (target->write_op_list != NULL) {
op_list = &(target->write_op_list);
else if (target->write_op_list_head != NULL) {
op_list_head = &(target->write_op_list_head);
op_list_tail = &(target->write_op_list_tail);
write_flag = 1;
}
else if (target->dt_op_list != NULL) {
op_list = &(target->dt_op_list);
else if (target->dt_op_list_head != NULL) {
op_list_head = &(target->dt_op_list_head);
op_list_tail = &(target->dt_op_list_tail);
}
else {
......@@ -376,7 +377,7 @@ static inline int MPIDI_CH3I_RMA_Cleanup_ops_target(MPID_Win * win_ptr, MPIDI_RM
goto fn_exit;
}
curr_op = *op_list;
curr_op = *op_list_head;
while (curr_op != NULL) {
for (i = 0; i < curr_op->reqs_size; i++) {
if (curr_op->reqs[i] == NULL)
......@@ -414,19 +415,19 @@ static inline int MPIDI_CH3I_RMA_Cleanup_ops_target(MPID_Win * win_ptr, MPIDI_RM
curr_op->reqs_size = 0;
/* dequeue the operation and free it */
MPL_LL_DELETE(*op_list, *op_list_tail, curr_op);
MPL_LL_DELETE(*op_list_head, *op_list_tail, curr_op);
MPIDI_CH3I_Win_op_free(win_ptr, curr_op);
if (*op_list == NULL) {
if (*op_list_head == NULL) {
if (read_flag == 1) {
read_flag = 0;
if (target->write_op_list != NULL) {
op_list = &(target->write_op_list);
if (target->write_op_list_head != NULL) {
op_list_head = &(target->write_op_list_head);
op_list_tail = &(target->write_op_list_tail);
write_flag = 1;
}
else if (target->dt_op_list != NULL) {
op_list = &(target->dt_op_list);
else if (target->dt_op_list_head != NULL) {
op_list_head = &(target->dt_op_list_head);
op_list_tail = &(target->dt_op_list_tail);
}
else
......@@ -434,8 +435,8 @@ static inline int MPIDI_CH3I_RMA_Cleanup_ops_target(MPID_Win * win_ptr, MPIDI_RM
}
else if (write_flag == 1) {
write_flag = 0;
if (target->dt_op_list != NULL) {
op_list = &(target->dt_op_list);
if (target->dt_op_list_head != NULL) {
op_list_head = &(target->dt_op_list_head);
op_list_tail = &(target->dt_op_list_tail);
}
else
......@@ -443,16 +444,16 @@ static inline int MPIDI_CH3I_RMA_Cleanup_ops_target(MPID_Win * win_ptr, MPIDI_RM
}
}
/* next op */
curr_op = *op_list;
curr_op = *op_list_head;
}
else
break;
}
cleanup_target:
if (target->pending_op_list == NULL &&
target->read_op_list == NULL && target->write_op_list == NULL &&
target->dt_op_list == NULL) {
if (target->pending_op_list_head == NULL &&
target->read_op_list_head == NULL && target->write_op_list_head == NULL &&
target->dt_op_list_head == NULL) {
(*local_completed) = 1;
......@@ -486,7 +487,7 @@ static inline int MPIDI_CH3I_RMA_Cleanup_ops_win(MPID_Win * win_ptr,
(*remote_completed) = 0;
for (i = 0; i < win_ptr->num_slots; i++) {
for (target = win_ptr->slots[i].target_list; target;) {
for (target = win_ptr->slots[i].target_list_head; target;) {
int local = 0, remote = 0;
mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, target, &local, &remote);
......@@ -544,7 +545,7 @@ static inline int MPIDI_CH3I_RMA_Cleanup_targets_win(MPID_Win * win_ptr)
int i, mpi_errno = MPI_SUCCESS;
for (i = 0; i < win_ptr->num_slots; i++) {
for (target = win_ptr->slots[i].target_list; target;) {
for (target = win_ptr->slots[i].target_list_head; target;) {
next_target = target->next;
mpi_errno = MPIDI_CH3I_RMA_Cleanup_single_target(win_ptr, target);
if (mpi_errno != MPI_SUCCESS)
......
......@@ -79,10 +79,10 @@ typedef struct MPIDI_RMA_Op {
} MPIDI_RMA_Op_t;
typedef struct MPIDI_RMA_Target {
struct MPIDI_RMA_Op *read_op_list, *read_op_list_tail;
struct MPIDI_RMA_Op *write_op_list, *write_op_list_tail;
struct MPIDI_RMA_Op *dt_op_list, *dt_op_list_tail;
struct MPIDI_RMA_Op *pending_op_list, *pending_op_list_tail;
struct MPIDI_RMA_Op *read_op_list_head, *read_op_list_tail;
struct MPIDI_RMA_Op *write_op_list_head, *write_op_list_tail;
struct MPIDI_RMA_Op *dt_op_list_head, *dt_op_list_tail;
struct MPIDI_RMA_Op *pending_op_list_head, *pending_op_list_tail;
struct MPIDI_RMA_Op *next_op_to_issue;
struct MPIDI_RMA_Target *next;
int target_rank;
......@@ -114,7 +114,7 @@ typedef struct MPIDI_RMA_Target {
} MPIDI_RMA_Target_t;
typedef struct MPIDI_RMA_Slot {
struct MPIDI_RMA_Target *target_list;
struct MPIDI_RMA_Target *target_list_head;
struct MPIDI_RMA_Target *target_list_tail;
} MPIDI_RMA_Slot_t;
......
......@@ -619,7 +619,7 @@ static inline int adjust_op_piggybacked_with_lock(MPID_Win * win_ptr,
MPIU_ERR_POP(mpi_errno);
MPIU_Assert(target != NULL);
op = target->pending_op_list;
op = target->pending_op_list_head;
if (op != NULL)
MPIDI_CH3_PKT_RMA_GET_FLAGS(op->pkt, op_flags, mpi_errno);
......@@ -636,14 +636,14 @@ static inline int adjust_op_piggybacked_with_lock(MPID_Win * win_ptr,
if (op->reqs_size == 0) {
MPIU_Assert(op->reqs == NULL);
MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list),
MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head),
&(target->pending_op_list_tail), op);
}
else {
MPI_Datatype target_datatype;
int is_derived = FALSE;
MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_op_list),
MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_op_list_head),
&(target->pending_op_list_tail), op);
MPIDI_CH3_PKT_RMA_GET_TARGET_DATATYPE(op->pkt, target_datatype, mpi_errno);
......@@ -658,18 +658,18 @@ static inline int adjust_op_piggybacked_with_lock(MPID_Win * win_ptr,
}
if (is_derived) {
MPIDI_CH3I_RMA_Ops_append(&(target->dt_op_list),
MPIDI_CH3I_RMA_Ops_append(&(target->dt_op_list_head),
&(target->dt_op_list_tail), op);
}
else if (op->pkt.type == MPIDI_CH3_PKT_PUT ||
op->pkt.type == MPIDI_CH3_PKT_PUT_IMMED ||
op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE ||
op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) {
MPIDI_CH3I_RMA_Ops_append(&(target->write_op_list),
MPIDI_CH3I_RMA_Ops_append(&(target->write_op_list_head),
&(target->write_op_list_tail), op);
}
else {
MPIDI_CH3I_RMA_Ops_append(&(target->read_op_list),
MPIDI_CH3I_RMA_Ops_append(&(target->read_op_list_head),
&(target->read_op_list_tail), op);
}
}
......
......@@ -159,8 +159,8 @@ static inline int check_target_state(MPID_Win * win_ptr, MPIDI_RMA_Target_t * ta
if (target->sync.sync_flag == MPIDI_RMA_SYNC_NONE ||
target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH_LOCAL ||
target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH) {
if (target->pending_op_list == NULL ||
!target->pending_op_list->piggyback_lock_candidate) {
if (target->pending_op_list_head == NULL ||
!target->pending_op_list_head->piggyback_lock_candidate) {
/* issue lock request */
target->access_state = MPIDI_RMA_LOCK_ISSUED;
if (target->target_rank == rank) {
......@@ -178,7 +178,7 @@ static inline int check_target_state(MPID_Win * win_ptr, MPIDI_RMA_Target_t * ta
}
}
else if (target->sync.sync_flag == MPIDI_RMA_SYNC_UNLOCK) {
if (target->pending_op_list == NULL) {
if (target->pending_op_list_head == NULL) {
/* No RMA operation has ever been posted to this target,
* finish issuing, no need to acquire the lock. Cleanup
* function will clean it up. */
......@@ -196,8 +196,8 @@ static inline int check_target_state(MPID_Win * win_ptr, MPIDI_RMA_Target_t * ta
/* if we reach WIN_UNLOCK and there is still operation existing
* in pending list, this operation must be the only operation
* and it is prepared to piggyback LOCK and UNLOCK. */
MPIU_Assert(target->pending_op_list->next == NULL);
MPIU_Assert(target->pending_op_list->piggyback_lock_candidate);
MPIU_Assert(target->pending_op_list_head->next == NULL);
MPIU_Assert(target->pending_op_list_head->piggyback_lock_candidate);
}
}
break;
......@@ -205,7 +205,7 @@ static inline int check_target_state(MPID_Win * win_ptr, MPIDI_RMA_Target_t * ta
case MPIDI_RMA_LOCK_GRANTED:
case MPIDI_RMA_NONE:
if (target->sync.sync_flag == MPIDI_RMA_SYNC_FLUSH) {
if (target->pending_op_list == NULL) {
if (target->pending_op_list_head == NULL) {
if (target->target_rank == rank) {
target->sync.outstanding_acks--;
MPIU_Assert(target->sync.outstanding_acks >= 0);
......@@ -232,7 +232,7 @@ static inline int check_target_state(MPID_Win * win_ptr, MPIDI_RMA_Target_t * ta
}
}
else if (target->sync.sync_flag == MPIDI_RMA_SYNC_UNLOCK) {
if (target->pending_op_list == NULL) {
if (target->pending_op_list_head == NULL) {
if (target->target_rank == rank) {
target->sync.outstanding_acks--;
MPIU_Assert(target->sync.outstanding_acks >= 0);
......@@ -405,7 +405,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
if (curr_op->reqs_size == 0) {
MPIU_Assert(curr_op->reqs == NULL);
/* Sending is completed immediately. */
MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list),
MPIDI_CH3I_RMA_Ops_free_elem(win_ptr, &(target->pending_op_list_head),
&(target->pending_op_list_tail), curr_op);
}
else {
......@@ -414,7 +414,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
/* Sending is not completed immediately. */
MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_op_list),
MPIDI_CH3I_RMA_Ops_unlink(&(target->pending_op_list_head),
&(target->pending_op_list_tail), curr_op);
MPIDI_CH3_PKT_RMA_GET_TARGET_DATATYPE(curr_op->pkt, target_datatype, mpi_errno);
......@@ -429,18 +429,18 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
}
if (is_derived) {
MPIDI_CH3I_RMA_Ops_append(&(target->dt_op_list),
MPIDI_CH3I_RMA_Ops_append(&(target->dt_op_list_head),
&(target->dt_op_list_tail), curr_op);
}
else if (curr_op->pkt.type == MPIDI_CH3_PKT_PUT ||
curr_op->pkt.type == MPIDI_CH3_PKT_PUT_IMMED ||
curr_op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE ||
curr_op->pkt.type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) {
MPIDI_CH3I_RMA_Ops_append(&(target->write_op_list),
MPIDI_CH3I_RMA_Ops_append(&(target->write_op_list_head),
&(target->write_op_list_tail), curr_op);
}
else {
MPIDI_CH3I_RMA_Ops_append(&(target->read_op_list),
MPIDI_CH3I_RMA_Ops_append(&(target->read_op_list_head),
&(target->read_op_list_tail), curr_op);
}
}
......@@ -487,7 +487,7 @@ static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress)
else
idx = i - win_ptr->num_slots;
target = win_ptr->slots[idx].target_list;
target = win_ptr->slots[idx].target_list_head;
while (target != NULL) {
int temp_progress = 0;
......@@ -524,7 +524,7 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
{
MPIDI_RMA_Op_t *curr_op = NULL;
MPIDI_RMA_Target_t *curr_target = NULL;
MPIDI_RMA_Op_t **op_list = NULL, **op_list_tail = NULL;
MPIDI_RMA_Op_t **op_list_head = NULL, **op_list_tail = NULL;
int read_flag = 0;
int i, made_progress = 0;
int mpi_errno = MPI_SUCCESS;
......@@ -546,10 +546,11 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
/* find targets that have operations */
for (i = 0; i < win_ptr->num_slots; i++) {
if (win_ptr->slots[i].target_list != NULL) {
curr_target = win_ptr->slots[i].target_list;
if (win_ptr->slots[i].target_list_head != NULL) {
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
if (curr_target->read_op_list != NULL || curr_target->write_op_list != NULL) {
if (curr_target->read_op_list_head != NULL ||
curr_target->write_op_list_head != NULL) {
if (win_ptr->states.access_state == MPIDI_RMA_PER_TARGET ||
win_ptr->states.access_state == MPIDI_RMA_LOCK_ALL_CALLED) {
if (curr_target->access_state == MPIDI_RMA_LOCK_GRANTED)
......@@ -573,18 +574,18 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
* must do a Win_flush instead. */
curr_target->disable_flush_local = 1;
if (curr_target->read_op_list != NULL) {
op_list = &curr_target->read_op_list;
if (curr_target->read_op_list_head != NULL) {
op_list_head = &curr_target->read_op_list_head;
op_list_tail = &curr_target->read_op_list_tail;
read_flag = 1;
}
else {
op_list = &curr_target->write_op_list;
op_list_head = &curr_target->write_op_list_head;
op_list_tail = &curr_target->write_op_list_tail;
}
/* free all ops in the list since we do not need to maintain them anymore */
for (curr_op = *op_list; curr_op != NULL;) {
for (curr_op = *op_list_head; curr_op != NULL;) {
if (curr_op->reqs_size > 0) {
MPIU_Assert(curr_op->reqs != NULL);
for (i = 0; i < curr_op->reqs_size; i++) {
......@@ -600,17 +601,17 @@ int MPIDI_CH3I_RMA_Free_ops_before_completion(MPID_Win * win_ptr)
curr_op->reqs = NULL;
curr_op->reqs_size = 0;
}
MPL_LL_DELETE(*op_list, *op_list_tail, curr_op);
MPL_LL_DELETE(*op_list_head, *op_list_tail, curr_op);
MPIDI_CH3I_Win_op_free(win_ptr, curr_op);
if (*op_list == NULL) {
if (*op_list_head == NULL) {
if (read_flag == 1) {
op_list = &curr_target->write_op_list;
op_list = &curr_target->write_op_list_tail;
op_list_head = &curr_target->write_op_list_head;
op_list_head = &curr_target->write_op_list_tail;
read_flag = 0;
}
}
curr_op = *op_list;
curr_op = *op_list_head;
}
fn_exit:
......@@ -638,9 +639,9 @@ int MPIDI_CH3I_RMA_Cleanup_ops_aggressive(MPID_Win * win_ptr)
/* find the first target that has something to issue */
for (i = 0; i < win_ptr->num_slots; i++) {
if (win_ptr->slots[i].target_list != NULL) {
curr_target = win_ptr->slots[i].target_list;
while (curr_target != NULL && curr_target->pending_op_list == NULL)
if (win_ptr->slots[i].target_list_head != NULL) {
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL && curr_target->pending_op_list_head == NULL)
curr_target = curr_target->next;
if (curr_target != NULL)
break;
......@@ -725,9 +726,9 @@ int MPIDI_CH3I_RMA_Cleanup_target_aggressive(MPID_Win * win_ptr, MPIDI_RMA_Targe
* target */
/* TODO: we should think about better strategies on selecting the target */
for (i = 0; i < win_ptr->num_slots; i++)
if (win_ptr->slots[i].target_list != NULL)
if (win_ptr->slots[i].target_list_head != NULL)
break;
curr_target = win_ptr->slots[i].target_list;
curr_target = win_ptr->slots[i].target_list_head;
if (curr_target->sync.sync_flag < MPIDI_RMA_SYNC_FLUSH) {
curr_target->sync.sync_flag = MPIDI_RMA_SYNC_FLUSH;
curr_target->sync.outstanding_acks++;
......
......@@ -368,7 +368,7 @@ int MPIDI_Win_fence(int assert, MPID_Win * win_ptr)
/* Set sync_flag in target structs. */
for (i = 0; i < win_ptr->num_slots; i++) {
curr_target = win_ptr->slots[i].target_list;
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
/* set sync_flag in sync struct */
......@@ -742,9 +742,9 @@ int MPIDI_Win_complete(MPID_Win * win_ptr)
}
if (win_comm_ptr->local_size <= win_ptr->num_slots)
curr_target = win_ptr->slots[dst].target_list;
curr_target = win_ptr->slots[dst].target_list_head;
else {
curr_target = win_ptr->slots[dst % win_ptr->num_slots].target_list;
curr_target = win_ptr->slots[dst % win_ptr->num_slots].target_list_head;
while (curr_target != NULL && curr_target->target_rank != dst)
curr_target = curr_target->next;
}
......@@ -1522,7 +1522,7 @@ int MPIDI_Win_unlock_all(MPID_Win * win_ptr)
if (win_ptr->states.access_state == MPIDI_RMA_LOCK_ALL_CALLED) {
for (i = 0; i < win_ptr->num_slots; i++) {
curr_target = win_ptr->slots[i].target_list;
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
if (curr_target->sync.sync_flag < sync_flag) {
curr_target->sync.sync_flag = sync_flag;
......@@ -1535,9 +1535,9 @@ int MPIDI_Win_unlock_all(MPID_Win * win_ptr)
else {
for (i = 0; i < win_ptr->comm_ptr->local_size; i++) {
if (win_ptr->comm_ptr->local_size <= win_ptr->num_slots)
curr_target = win_ptr->slots[i].target_list;
curr_target = win_ptr->slots[i].target_list_head;
else {
curr_target = win_ptr->slots[i % win_ptr->num_slots].target_list;
curr_target = win_ptr->slots[i % win_ptr->num_slots].target_list_head;
while (curr_target != NULL && curr_target->target_rank != i)
curr_target = curr_target->next;
}
......@@ -1662,7 +1662,7 @@ int MPIDI_Win_flush_all(MPID_Win * win_ptr)
/* Set sync_flag in sync struct. */
for (i = 0; i < win_ptr->num_slots; i++) {
curr_target = win_ptr->slots[i].target_list;
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
if (curr_target->sync.sync_flag < MPIDI_RMA_SYNC_FLUSH) {
curr_target->sync.sync_flag = MPIDI_RMA_SYNC_FLUSH;
......@@ -1756,7 +1756,7 @@ int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
/* Set sync_flag in sync struct. */
for (i = 0; i < win_ptr->num_slots; i++) {
curr_target = win_ptr->slots[i].target_list;
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
if (curr_target->disable_flush_local) {
if (curr_target->sync.sync_flag < MPIDI_RMA_SYNC_FLUSH) {
......@@ -1788,7 +1788,7 @@ int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
* and wait for local completion for other targets */
do {
for (i = 0; i < win_ptr->num_slots; i++) {
curr_target = win_ptr->slots[i].target_list;
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
mpi_errno = MPIDI_CH3I_RMA_Cleanup_ops_target(win_ptr, curr_target,
&local_completed, &remote_completed);
......@@ -1825,7 +1825,7 @@ int MPIDI_Win_flush_local_all(MPID_Win * win_ptr)
finish_flush_local_all:
/* reset disable_flush_local flag in target to 0 */
for (i = 0; i < win_ptr->num_slots; i++) {
curr_target = win_ptr->slots[i].target_list;
curr_target = win_ptr->slots[i].target_list_head;
while (curr_target != NULL) {
curr_target->disable_flush_local = 0;
curr_target = curr_target->next;
......
......@@ -371,7 +371,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
MPIU_CHKPMEM_MALLOC((*win_ptr)->slots, MPIDI_RMA_Slot_t *,
sizeof(MPIDI_RMA_Slot_t) * (*win_ptr)->num_slots, mpi_errno, "RMA slots");
for (i = 0; i < (*win_ptr)->num_slots; i++) {
(*win_ptr)->slots[i].target_list = NULL;
(*win_ptr)->slots[i].target_list_head = NULL;
(*win_ptr)->slots[i].target_list_tail = NULL;
}
......
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