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

Move check_and_switch_target/window_state() into issue_ops_target/window().


Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent ec785084
......@@ -298,10 +298,18 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ
{
MPIDI_RMA_Op_t *curr_op = NULL;
MPIDI_CH3_Pkt_flags_t flags;
int is_able_to_issue = 0;
int first_op = 1, mpi_errno = MPI_SUCCESS;
(*made_progress) = 0;
/* check and try to switch target state */
mpi_errno = check_and_switch_target_state(win_ptr, target, &is_able_to_issue, made_progress);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (!is_able_to_issue)
goto fn_exit;
if (win_ptr->non_empty_slots == 0 || target == NULL)
goto fn_exit;
......@@ -462,10 +470,18 @@ static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress)
{
int mpi_errno = MPI_SUCCESS;
int start_slot, end_slot, i, idx;
int is_able_to_issue = 0;
MPIDI_RMA_Target_t *target = NULL;
(*made_progress) = 0;
/* check and try to switch window state */
mpi_errno = check_and_switch_window_state(win_ptr, &is_able_to_issue, made_progress);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (!is_able_to_issue)
goto fn_exit;
if (win_ptr->non_empty_slots == 0)
goto fn_exit;
......@@ -482,19 +498,6 @@ static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress)
target = win_ptr->slots[idx].target_list_head;
while (target != NULL) {
int temp_progress = 0;
int is_able_to_issue = 0;
/* check target state */
mpi_errno = check_and_switch_target_state(win_ptr, target, &is_able_to_issue,
&temp_progress);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (temp_progress)
(*made_progress) = 1;
if (!is_able_to_issue) {
target = target->next;
continue;
}
/* issue operations to this target */
mpi_errno = issue_ops_target(win_ptr, target, &temp_progress);
......@@ -800,15 +803,6 @@ int MPIDI_CH3I_RMA_Make_progress_target(MPID_Win * win_ptr, int target_rank, int
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
/* check target state */
mpi_errno = check_and_switch_target_state(win_ptr, target, &is_able_to_issue, &temp_progress);
if (mpi_errno)
MPIU_ERR_POP(mpi_errno);
if (temp_progress)
(*made_progress) = 1;
if (!is_able_to_issue)
goto fn_exit;
/* issue operations to this target */
mpi_errno = issue_ops_target(win_ptr, target, &temp_progress);
if (mpi_errno)
......@@ -830,20 +824,10 @@ int MPIDI_CH3I_RMA_Make_progress_target(MPID_Win * win_ptr, int target_rank, int
int MPIDI_CH3I_RMA_Make_progress_win(MPID_Win * win_ptr, int *made_progress)
{
int temp_progress = 0;
int is_able_to_issue = 0;
int mpi_errno = MPI_SUCCESS;
(*made_progress) = 0;
/* check window state */
mpi_errno = check_and_switch_window_state(win_ptr, &is_able_to_issue, &temp_progress);
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (temp_progress)
(*made_progress) = 1;
if (!is_able_to_issue)
goto fn_exit;
/* issue operations on window */
mpi_errno = issue_ops_win(win_ptr, &temp_progress);
if (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