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

Improvement for IBARRIER when number of processes is 1.



When number of processes is only 1, we do not need to schedule
the current NBC communication but can just return a REQUEST_NULL
request handle. This patch fixes this issue.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent b30fe09a
......@@ -190,6 +190,7 @@ int MPIR_Ibarrier_impl(MPID_Comm *comm_ptr, MPI_Request *request)
/* --END USEREXTENSION-- */
}
if (comm_ptr->local_size != 1) {
mpi_errno = MPID_Sched_next_tag(comm_ptr, &tag);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Sched_create(&s);
......@@ -203,6 +204,7 @@ int MPIR_Ibarrier_impl(MPID_Comm *comm_ptr, MPI_Request *request)
if (reqp)
*request = reqp->handle;
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
fn_exit:
return mpi_errno;
......
......@@ -537,9 +537,15 @@ int MPIDI_Win_fence(int assert, MPID_Win * win_ptr)
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (win_ptr->fence_sync_req == MPI_REQUEST_NULL) {
/* ibarrier completed immediately. */
win_ptr->states.access_state = MPIDI_RMA_FENCE_GRANTED;
}
else {
/* Set window access state properly. */
win_ptr->states.access_state = MPIDI_RMA_FENCE_ISSUED;
MPIDI_CH3I_num_active_issued_win++;
}
goto finish_fence;
}
......@@ -644,8 +650,15 @@ int MPIDI_Win_fence(int assert, MPID_Win * win_ptr)
mpi_errno = MPIR_Ibarrier_impl(win_ptr->comm_ptr, &(win_ptr->fence_sync_req));
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
if (win_ptr->fence_sync_req == MPI_REQUEST_NULL) {
/* ibarrier completed immediately. */
win_ptr->states.access_state = MPIDI_RMA_FENCE_GRANTED;
}
else {
MPIDI_CH3I_num_active_issued_win++;
win_ptr->states.access_state = MPIDI_RMA_FENCE_ISSUED;
}
if (win_ptr->shm_allocated == TRUE) {
MPID_Comm *node_comm_ptr = win_ptr->comm_ptr->node_comm;
......
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