Commit 1b30ab19 authored by Xin Zhao's avatar Xin Zhao
Browse files

Change argument of function finish_op_on_target.



In this patch, we replace one argument of function
finish_op_on_target, "packet(op) type", with "has_response_data".
Since finish_op_on_target does not care what specific
packet(op) type it is processing on, but only cares
about if the current op has response data (like GET/GACC),
changing the argument in this way can simplify the
code by avoiding acquiring packet(op) type everytime
before calling finish_op_on_target.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 21479b00
......@@ -851,13 +851,12 @@ static inline int check_piggyback_lock(MPID_Win *win_ptr, MPIDI_VC_t *vc,
}
static inline int finish_op_on_target(MPID_Win *win_ptr, MPIDI_VC_t *vc,
MPIDI_CH3_Pkt_type_t type,
int has_response_data,
MPIDI_CH3_Pkt_flags_t flags,
MPI_Win source_win_handle) {
int mpi_errno = MPI_SUCCESS;
if (type == MPIDI_CH3_PKT_PUT || type == MPIDI_CH3_PKT_PUT_IMMED ||
type == MPIDI_CH3_PKT_ACCUMULATE_IMMED || type == MPIDI_CH3_PKT_ACCUMULATE) {
if (!has_response_data) {
/* This is PUT or ACC */
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE) {
......
......@@ -113,7 +113,7 @@ int MPIDI_CH3_ReqHandler_PutRecvComplete( MPIDI_VC_t *vc,
because inside finish_op_on_target() we may call this request handler
on the same request again (in release_lock()). Marking this request as
completed will prevent us from processing the same request twice. */
mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_PUT,
mpi_errno = finish_op_on_target(win_ptr, vc, FALSE /* has no response data */,
flags, source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......@@ -191,7 +191,7 @@ int MPIDI_CH3_ReqHandler_AccumRecvComplete( MPIDI_VC_t *vc,
because inside finish_op_on_target() we may call this request handler
on the same request again (in release_lock()). Marking this request as
completed will prevent us from processing the same request twice. */
mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_ACCUMULATE,
mpi_errno = finish_op_on_target(win_ptr, vc, FALSE /* has no response data */,
flags, source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......@@ -957,7 +957,7 @@ static inline int perform_put_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_en
}
/* do final action */
mpi_errno = finish_op_on_target(win_ptr, lock_entry->vc, put_pkt->type,
mpi_errno = finish_op_on_target(win_ptr, lock_entry->vc, FALSE /* has no response data */,
put_pkt->flags, put_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......@@ -1087,7 +1087,7 @@ static inline int perform_acc_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_en
if (win_ptr->shm_allocated == TRUE)
MPIDI_CH3I_SHM_MUTEX_UNLOCK(win_ptr);
mpi_errno = finish_op_on_target(win_ptr, lock_entry->vc, acc_pkt->type,
mpi_errno = finish_op_on_target(win_ptr, lock_entry->vc, FALSE /* has no response data */,
acc_pkt->flags, acc_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......@@ -1360,7 +1360,7 @@ static inline int perform_fop_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_en
}
/* do final action */
mpi_errno = finish_op_on_target(win_ptr, lock_entry->vc, fop_pkt->type,
mpi_errno = finish_op_on_target(win_ptr, lock_entry->vc, TRUE /* has response data */,
fop_pkt->flags, fop_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......@@ -1442,7 +1442,7 @@ static inline int perform_cas_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_en
}
/* do final action */
mpi_errno = finish_op_on_target(win_ptr, lock_entry->vc, cas_pkt->type,
mpi_errno = finish_op_on_target(win_ptr, lock_entry->vc, TRUE /* has response data */,
cas_pkt->flags, cas_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......
......@@ -84,7 +84,7 @@ int MPIDI_CH3_ReqHandler_GetSendComplete( MPIDI_VC_t *vc ATTRIBUTE((unused)),
because inside finish_op_on_target() we may call this request handler
on the same request again (in release_lock()). Marking this request as
completed will prevent us from processing the same request twice. */
mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_GET,
mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */,
flags, source_win_handle);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......@@ -149,7 +149,7 @@ int MPIDI_CH3_ReqHandler_GaccumSendComplete( MPIDI_VC_t *vc,
because inside finish_op_on_target() we may call this request handler
on the same request again (in release_lock()). Marking this request as
completed will prevent us from processing the same request twice. */
mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_GET_ACCUM,
mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */,
flags, source_win_handle);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......@@ -217,7 +217,7 @@ int MPIDI_CH3_ReqHandler_CASSendComplete( MPIDI_VC_t *vc,
because inside finish_op_on_target() we may call this request handler
on the same request again (in release_lock()). Marking this request as
completed will prevent us from processing the same request twice. */
mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_CAS_IMMED,
mpi_errno = finish_op_on_target(win_ptr, vc, TRUE/* has response data */,
flags, source_win_handle);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......@@ -283,7 +283,7 @@ int MPIDI_CH3_ReqHandler_FOPSendComplete( MPIDI_VC_t *vc,
because inside finish_op_on_target() we may call this request handler
on the same request again (in release_lock()). Marking this request as
completed will prevent us from processing the same request twice. */
mpi_errno = finish_op_on_target(win_ptr, vc, MPIDI_CH3_PKT_FOP,
mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */,
flags, source_win_handle);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......
......@@ -225,7 +225,7 @@ int MPIDI_CH3_PktHandler_Put(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIU_Memcpy(put_pkt->addr, put_pkt->info.data, put_pkt->count*type_size);
/* trigger final action */
mpi_errno = finish_op_on_target(win_ptr, vc, pkt->type,
mpi_errno = finish_op_on_target(win_ptr, vc, FALSE /* has no response data */,
put_pkt->flags, put_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......@@ -577,7 +577,7 @@ int MPIDI_CH3_PktHandler_Accumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
}
/* trigger final action */
mpi_errno = finish_op_on_target(win_ptr, vc, pkt->type,
mpi_errno = finish_op_on_target(win_ptr, vc, FALSE /* has no response data */,
accum_pkt->flags, accum_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......@@ -1074,7 +1074,7 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPID_Request_release(req);
}
mpi_errno = finish_op_on_target(win_ptr, vc, cas_pkt->type,
mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */,
cas_pkt->flags, cas_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
......@@ -1247,7 +1247,7 @@ int MPIDI_CH3_PktHandler_FOP(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
}
}
mpi_errno = finish_op_on_target(win_ptr, vc, fop_pkt->type,
mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */,
fop_pkt->flags, fop_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(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