Commit 80a71e11 authored by Xin Zhao's avatar Xin Zhao
Browse files

Remove source_win_handle from GET-like RMA packets.



For GET-like RMA packets and response packets (GACC,
GET, FOP, CAS, GACC_RESP, GET_RESP, FOP_RESP, CAS_RESP),
originally we carry source_win_handle in packet struct
in order to locate window handle on origin side in the
packet handler of response packets. However, this is
not necessary because source_win_handle can be stored
in the request on the origin side. This patch delete
source_win_handle from those packets to reduce the size
of packet union.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 42c52518
......@@ -458,7 +458,7 @@ static int issue_get_acc_op(MPIDI_RMA_Op_t *rma_op, MPID_Win *win_ptr,
resp_req->dev.user_count = rma_op->result_count;
resp_req->dev.datatype = rma_op->result_datatype;
resp_req->dev.target_win_handle = get_accum_pkt->target_win_handle;
resp_req->dev.source_win_handle = get_accum_pkt->source_win_handle;
resp_req->dev.source_win_handle = win_ptr->handle;
if (!MPIR_DATATYPE_IS_PREDEFINED(resp_req->dev.datatype)) {
MPID_Datatype *result_dtp = NULL;
......@@ -572,7 +572,7 @@ static int issue_get_op(MPIDI_RMA_Op_t * rma_op, MPID_Win * win_ptr,
rma_op->request->dev.user_count = rma_op->origin_count;
rma_op->request->dev.datatype = rma_op->origin_datatype;
rma_op->request->dev.target_win_handle = MPI_WIN_NULL;
rma_op->request->dev.source_win_handle = get_pkt->source_win_handle;
rma_op->request->dev.source_win_handle = win_ptr->handle;
if (!MPIR_DATATYPE_IS_PREDEFINED(rma_op->request->dev.datatype)) {
MPID_Datatype_get_ptr(rma_op->request->dev.datatype, dtp);
rma_op->request->dev.datatype_ptr = dtp;
......@@ -671,7 +671,7 @@ static int issue_cas_op(MPIDI_RMA_Op_t * rma_op,
rma_op->request->dev.datatype = rma_op->result_datatype;
rma_op->request->dev.target_win_handle = cas_pkt->target_win_handle;
rma_op->request->dev.source_win_handle = cas_pkt->source_win_handle;
rma_op->request->dev.source_win_handle = win_ptr->handle;
cas_pkt->request_handle = rma_op->request->handle;
cas_pkt->flags |= flags;
......@@ -736,7 +736,7 @@ static int issue_fop_op(MPIDI_RMA_Op_t * rma_op,
resp_req->dev.user_count = rma_op->result_count;
resp_req->dev.datatype = rma_op->result_datatype;
resp_req->dev.target_win_handle = fop_pkt->target_win_handle;
resp_req->dev.source_win_handle = fop_pkt->source_win_handle;
resp_req->dev.source_win_handle = win_ptr->handle;
fop_pkt->request_handle = resp_req->handle;
......
......@@ -442,39 +442,10 @@ MPIDI_CH3_PKT_DEFS
case (MPIDI_CH3_PKT_PUT_IMMED): \
win_hdl_ = (pkt_).put.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_GET): \
win_hdl_ = (pkt_).get.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_ACCUMULATE): \
case (MPIDI_CH3_PKT_ACCUMULATE_IMMED): \
win_hdl_ = (pkt_).accum.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_GET_ACCUM): \
case (MPIDI_CH3_PKT_GET_ACCUM_IMMED): \
win_hdl_ = (pkt_).get_accum.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_CAS_IMMED): \
win_hdl_ = (pkt_).cas.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_FOP): \
case (MPIDI_CH3_PKT_FOP_IMMED): \
win_hdl_ = (pkt_).fop.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_GET_RESP): \
case (MPIDI_CH3_PKT_GET_RESP_IMMED): \
win_hdl_ = (pkt_).get_resp.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_GET_ACCUM_RESP): \
case (MPIDI_CH3_PKT_GET_ACCUM_RESP_IMMED): \
win_hdl_ = (pkt_).get_accum_resp.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_FOP_RESP): \
case (MPIDI_CH3_PKT_FOP_RESP_IMMED): \
win_hdl_ = (pkt_).fop_resp.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_CAS_RESP_IMMED): \
win_hdl_ = (pkt_).cas_resp.source_win_handle; \
break; \
case (MPIDI_CH3_PKT_LOCK): \
win_hdl_ = (pkt_).lock.source_win_handle; \
break; \
......@@ -567,6 +538,53 @@ MPIDI_CH3_PKT_DEFS
} \
}
#define MPIDI_CH3_PKT_RMA_GET_REQUEST_HANDLE(pkt_, request_hdl_, err_) \
{ \
err_ = MPI_SUCCESS; \
switch((pkt_).type) { \
case (MPIDI_CH3_PKT_GET): \
request_hdl_ = (pkt_).get.request_handle; \
break; \
case (MPIDI_CH3_PKT_GET_ACCUM): \
case (MPIDI_CH3_PKT_GET_ACCUM_IMMED): \
request_hdl_ = (pkt_).get_accum.request_handle; \
break; \
case (MPIDI_CH3_PKT_CAS_IMMED): \
request_hdl_ = (pkt_).cas.request_handle; \
break; \
case (MPIDI_CH3_PKT_FOP): \
case (MPIDI_CH3_PKT_FOP_IMMED): \
request_hdl_ = (pkt_).fop.request_handle; \
break; \
case (MPIDI_CH3_PKT_GET_RESP): \
case (MPIDI_CH3_PKT_GET_RESP_IMMED): \
request_hdl_ = (pkt_).get_resp.request_handle; \
break; \
case (MPIDI_CH3_PKT_GET_ACCUM_RESP): \
case (MPIDI_CH3_PKT_GET_ACCUM_RESP_IMMED): \
request_hdl_ = (pkt_).get_accum_resp.request_handle; \
break; \
case (MPIDI_CH3_PKT_FOP_RESP): \
case (MPIDI_CH3_PKT_FOP_RESP_IMMED): \
request_hdl_ = (pkt_).fop_resp.request_handle; \
break; \
case (MPIDI_CH3_PKT_CAS_RESP_IMMED): \
request_hdl_ = (pkt_).cas_resp.request_handle; \
break; \
case (MPIDI_CH3_PKT_LOCK): \
request_hdl_ = (pkt_).lock.request_handle; \
break; \
case (MPIDI_CH3_PKT_LOCK_ACK): \
request_hdl_ = (pkt_).lock_ack.request_handle; \
break; \
case (MPIDI_CH3_PKT_LOCK_OP_ACK): \
request_hdl_ = (pkt_).lock_op_ack.request_handle; \
break; \
default: \
MPIU_ERR_SETANDJUMP1(err_, MPI_ERR_OTHER, "**invalidpkt", "**invalidpkt %d", (pkt_).type); \
} \
}
typedef struct MPIDI_CH3_Pkt_put {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
......@@ -603,9 +621,6 @@ typedef struct MPIDI_CH3_Pkt_get {
* epoch for decrementing rma op counter in
* active target rma and for unlocking window
* in passive target rma. Otherwise set to NULL*/
MPI_Win source_win_handle; /* Used in the last RMA operation in an
* epoch in the case of passive target rma
* with shared locks. Otherwise set to NULL*/
} MPIDI_CH3_Pkt_get_t;
typedef struct MPIDI_CH3_Pkt_get_resp {
......@@ -613,7 +628,6 @@ typedef struct MPIDI_CH3_Pkt_get_resp {
MPI_Request request_handle;
/* followings are used to decrement ack_counter at origin */
int target_rank;
MPI_Win source_win_handle;
MPIDI_CH3_Pkt_flags_t flags;
/* Followings are to piggyback IMMED data */
struct {
......@@ -656,9 +670,6 @@ typedef struct MPIDI_CH3_Pkt_get_accum {
* epoch for decrementing rma op counter in
* active target rma and for unlocking window
* in passive target rma. Otherwise set to NULL*/
MPI_Win source_win_handle; /* Used in the last RMA operation in an
* epoch in the case of passive target rma
* with shared locks. Otherwise set to NULL*/
union {
int dataloop_size;
char data[MPIDI_RMA_IMMED_BYTES];
......@@ -670,7 +681,6 @@ typedef struct MPIDI_CH3_Pkt_get_accum_resp {
MPI_Request request_handle;
/* followings are used to decrement ack_counter at origin */
int target_rank;
MPI_Win source_win_handle;
MPIDI_CH3_Pkt_flags_t flags;
/* Followings are to piggyback IMMED data */
struct {
......@@ -687,7 +697,6 @@ typedef struct MPIDI_CH3_Pkt_cas {
MPI_Datatype datatype;
void *addr;
MPI_Request request_handle;
MPI_Win source_win_handle;
MPI_Win target_win_handle; /* Used in the last RMA operation in each
* epoch for decrementing rma op counter in
* active target rma and for unlocking window
......@@ -707,7 +716,6 @@ typedef struct MPIDI_CH3_Pkt_cas_resp {
} info;
/* followings are used to decrement ack_counter at orign */
int target_rank;
MPI_Win source_win_handle;
MPIDI_CH3_Pkt_flags_t flags;
} MPIDI_CH3_Pkt_cas_resp_t;
......@@ -718,7 +726,6 @@ typedef struct MPIDI_CH3_Pkt_fop {
void *addr;
MPI_Op op;
MPI_Request request_handle;
MPI_Win source_win_handle;
MPI_Win target_win_handle; /* Used in the last RMA operation in each
* epoch for decrementing rma op counter in
* active target rma and for unlocking window
......@@ -742,7 +749,6 @@ typedef struct MPIDI_CH3_Pkt_fop_resp {
} info;
/* followings are used to decrement ack_counter at orign */
int target_rank;
MPI_Win source_win_handle;
MPIDI_CH3_Pkt_flags_t flags;
} MPIDI_CH3_Pkt_fop_resp_t;
......@@ -750,7 +756,14 @@ typedef struct MPIDI_CH3_Pkt_lock {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
MPI_Win target_win_handle;
/* Note that either source_win_handle
or request_handle will be used. Here
we need both of them because PUT/GET
may be converted to LOCK packet,
PUT has source_win_handle area and
GET has request_handle area. */
MPI_Win source_win_handle;
MPI_Request request_handle;
} MPIDI_CH3_Pkt_lock_t;
typedef struct MPIDI_CH3_Pkt_unlock {
......@@ -769,7 +782,10 @@ typedef struct MPIDI_CH3_Pkt_flush {
typedef struct MPIDI_CH3_Pkt_lock_ack {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
/* note that either source_win_handle
or request_handle is used. */
MPI_Win source_win_handle;
MPI_Request request_handle;
int target_rank; /* Used in flush_ack response to look up the
* target state at the origin. */
} MPIDI_CH3_Pkt_lock_ack_t;
......@@ -777,7 +793,10 @@ typedef struct MPIDI_CH3_Pkt_lock_ack {
typedef struct MPIDI_CH3_Pkt_lock_op_ack {
MPIDI_CH3_Pkt_type_t type;
MPIDI_CH3_Pkt_flags_t flags;
/* note that either source_win_handle
or request_handle is used. */
MPI_Win source_win_handle;
MPI_Request request_handle;
int target_rank;
} MPIDI_CH3_Pkt_lock_op_ack_t;
......
......@@ -32,6 +32,7 @@ static inline int send_lock_msg(int dest, int lock_type, MPID_Win * win_ptr)
MPIDI_Pkt_init(lock_pkt, MPIDI_CH3_PKT_LOCK);
lock_pkt->target_win_handle = win_ptr->all_win_handles[dest];
lock_pkt->source_win_handle = win_ptr->handle;
lock_pkt->request_handle = MPI_REQUEST_NULL;
lock_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (lock_type == MPI_LOCK_SHARED)
lock_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED;
......@@ -110,7 +111,8 @@ static inline int send_unlock_msg(int dest, MPID_Win * win_ptr,
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr,
MPIDI_CH3_Pkt_flags_t flags,
MPI_Win source_win_handle)
MPI_Win source_win_handle,
MPI_Request request_handle)
{
MPIDI_CH3_Pkt_t upkt;
MPIDI_CH3_Pkt_lock_ack_t *lock_ack_pkt = &upkt.lock_ack;
......@@ -120,9 +122,12 @@ static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_p
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_LOCK_ACK_PKT);
MPIU_Assert(!(source_win_handle != MPI_WIN_NULL && request_handle != MPI_REQUEST_NULL));
/* send lock ack packet */
MPIDI_Pkt_init(lock_ack_pkt, MPIDI_CH3_PKT_LOCK_ACK);
lock_ack_pkt->source_win_handle = source_win_handle;
lock_ack_pkt->request_handle = request_handle;
lock_ack_pkt->target_rank = win_ptr->comm_ptr->rank;
lock_ack_pkt->flags = flags;
......@@ -153,7 +158,8 @@ static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_p
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline int MPIDI_CH3I_Send_lock_op_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr,
MPIDI_CH3_Pkt_flags_t flags,
MPI_Win source_win_handle)
MPI_Win source_win_handle,
MPI_Request request_handle)
{
MPIDI_CH3_Pkt_t upkt;
MPIDI_CH3_Pkt_lock_op_ack_t *lock_op_ack_pkt = &upkt.lock_op_ack;
......@@ -163,9 +169,12 @@ static inline int MPIDI_CH3I_Send_lock_op_ack_pkt(MPIDI_VC_t * vc, MPID_Win * wi
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_LOCK_OP_ACK_PKT);
MPIU_Assert(!(source_win_handle != MPI_WIN_NULL && request_handle != MPI_REQUEST_NULL));
/* send lock ack packet */
MPIDI_Pkt_init(lock_op_ack_pkt, MPIDI_CH3_PKT_LOCK_OP_ACK);
lock_op_ack_pkt->source_win_handle = source_win_handle;
lock_op_ack_pkt->request_handle = request_handle;
lock_op_ack_pkt->target_rank = win_ptr->comm_ptr->rank;
lock_op_ack_pkt->flags = flags;
......@@ -318,6 +327,7 @@ static inline int enqueue_lock_origin(MPID_Win *win_ptr, MPIDI_VC_t *vc,
MPIDI_RMA_Lock_entry_t *new_ptr = NULL;
MPIDI_CH3_Pkt_flags_t flag;
MPI_Win source_win_handle;
MPI_Request request_handle;
int lock_discarded = 0, data_discarded = 0;
int mpi_errno = MPI_SUCCESS;
......@@ -385,12 +395,21 @@ static inline int enqueue_lock_origin(MPID_Win *win_ptr, MPIDI_VC_t *vc,
MPIDI_CH3_Pkt_flags_t flags;
MPIDI_CH3_PKT_RMA_GET_TARGET_WIN_HANDLE((*pkt), target_win_handle, mpi_errno);
MPIDI_CH3_PKT_RMA_GET_SOURCE_WIN_HANDLE((*pkt), source_win_handle, mpi_errno);
MPIDI_CH3_PKT_RMA_GET_FLAGS((*pkt), flags, mpi_errno);
if (pkt->type == MPIDI_CH3_PKT_PUT || pkt->type == MPIDI_CH3_PKT_ACCUMULATE) {
MPIDI_CH3_PKT_RMA_GET_SOURCE_WIN_HANDLE((*pkt), source_win_handle, mpi_errno);
request_handle = MPI_REQUEST_NULL;
}
else {
source_win_handle = MPI_WIN_NULL;
MPIDI_CH3_PKT_RMA_GET_REQUEST_HANDLE((*pkt), request_handle, mpi_errno);
}
MPIDI_Pkt_init(lock_pkt, MPIDI_CH3_PKT_LOCK);
lock_pkt->target_win_handle = target_win_handle;
lock_pkt->source_win_handle = source_win_handle;
lock_pkt->request_handle = request_handle;
lock_pkt->flags = flags;
/* replace original pkt with lock pkt */
......@@ -456,12 +475,14 @@ static inline int enqueue_lock_origin(MPID_Win *win_ptr, MPIDI_VC_t *vc,
}
issue_ack:
MPIDI_CH3_PKT_RMA_GET_SOURCE_WIN_HANDLE((*pkt), source_win_handle, mpi_errno);
if (pkt->type == MPIDI_CH3_PKT_LOCK) {
if (lock_discarded) flag = MPIDI_CH3_PKT_FLAG_RMA_LOCK_DISCARDED;
else flag = MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_QUEUED;
mpi_errno = MPIDI_CH3I_Send_lock_ack_pkt(vc, win_ptr, flag, source_win_handle);
MPIDI_CH3_PKT_RMA_GET_SOURCE_WIN_HANDLE((*pkt), source_win_handle, mpi_errno);
MPIDI_CH3_PKT_RMA_GET_REQUEST_HANDLE((*pkt), request_handle, mpi_errno);
mpi_errno = MPIDI_CH3I_Send_lock_ack_pkt(vc, win_ptr, flag, source_win_handle, request_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
else {
......@@ -469,7 +490,17 @@ static inline int enqueue_lock_origin(MPID_Win *win_ptr, MPIDI_VC_t *vc,
else if (data_discarded) flag = MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_DISCARDED;
else flag = MPIDI_CH3_PKT_FLAG_RMA_LOCK_QUEUED_DATA_QUEUED;
mpi_errno = MPIDI_CH3I_Send_lock_op_ack_pkt(vc, win_ptr, flag, source_win_handle);
if (pkt->type == MPIDI_CH3_PKT_PUT || pkt->type == MPIDI_CH3_PKT_PUT_IMMED ||
pkt->type == MPIDI_CH3_PKT_ACCUMULATE || pkt->type == MPIDI_CH3_PKT_ACCUMULATE_IMMED) {
MPIDI_CH3_PKT_RMA_GET_SOURCE_WIN_HANDLE((*pkt), source_win_handle, mpi_errno);
request_handle = MPI_REQUEST_NULL;
}
else {
source_win_handle = MPI_WIN_NULL;
MPIDI_CH3_PKT_RMA_GET_REQUEST_HANDLE((*pkt), request_handle, mpi_errno);
}
mpi_errno = MPIDI_CH3I_Send_lock_op_ack_pkt(vc, win_ptr, flag, source_win_handle, request_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
......@@ -864,9 +895,11 @@ static inline int finish_op_on_target(MPID_Win *win_ptr, MPIDI_VC_t *vc,
if ((flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) ||
(flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK))
pkt_flags |= MPIDI_CH3_PKT_FLAG_RMA_FLUSH_ACK;
MPIU_Assert(source_win_handle != MPI_WIN_NULL);
mpi_errno = MPIDI_CH3I_Send_lock_op_ack_pkt(vc, win_ptr,
pkt_flags,
source_win_handle);
source_win_handle,
MPI_REQUEST_NULL);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
MPIDI_CH3_Progress_signal_completion();
}
......
......@@ -240,7 +240,6 @@ int MPIDI_CH3_ReqHandler_GaccumRecvComplete( MPIDI_VC_t *vc,
}
get_accum_resp_pkt->request_handle = rreq->dev.resp_request_handle;
get_accum_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
get_accum_resp_pkt->source_win_handle = rreq->dev.source_win_handle;
get_accum_resp_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE)
......@@ -418,7 +417,6 @@ int MPIDI_CH3_ReqHandler_FOPRecvComplete( MPIDI_VC_t *vc,
/* Send back data */
MPIDI_Pkt_init(fop_resp_pkt, MPIDI_CH3_PKT_FOP_RESP);
fop_resp_pkt->request_handle = rreq->dev.resp_request_handle;
fop_resp_pkt->source_win_handle = rreq->dev.source_win_handle;
fop_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
fop_resp_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
......@@ -694,13 +692,11 @@ int MPIDI_CH3_ReqHandler_GetDerivedDTRecvComplete( MPIDI_VC_t *vc,
sreq->dev.datatype = new_dtp->handle;
sreq->dev.datatype_ptr = new_dtp;
sreq->dev.target_win_handle = rreq->dev.target_win_handle;
sreq->dev.source_win_handle = rreq->dev.source_win_handle;
sreq->dev.flags = rreq->dev.flags;
MPIDI_Pkt_init(get_resp_pkt, MPIDI_CH3_PKT_GET_RESP);
get_resp_pkt->request_handle = rreq->dev.request_handle;
get_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
get_resp_pkt->source_win_handle = rreq->dev.source_win_handle;
get_resp_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
rreq->dev.flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE)
......@@ -1022,7 +1018,6 @@ static inline int perform_get_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_en
(get_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK))
get_resp_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_FLUSH_ACK;
get_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
get_resp_pkt->source_win_handle = get_pkt->source_win_handle;
/* length of target data */
MPID_Datatype_get_size_macro(get_pkt->datatype, type_size);
......@@ -1211,7 +1206,6 @@ static inline int perform_get_acc_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Loc
(get_accum_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK))
get_accum_resp_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_FLUSH_ACK;
get_accum_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
get_accum_resp_pkt->source_win_handle = get_accum_pkt->source_win_handle;
if (get_accum_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_IMMED_RESP) {
/* All origin data is in packet header, issue the header. */
......@@ -1270,7 +1264,6 @@ static inline int perform_fop_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_en
}
fop_resp_pkt->request_handle = fop_pkt->request_handle;
fop_resp_pkt->source_win_handle = fop_pkt->source_win_handle;
fop_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
fop_resp_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (fop_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
......@@ -1379,7 +1372,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, TRUE /* has response data */,
fop_pkt->flags, fop_pkt->source_win_handle);
fop_pkt->flags, MPI_WIN_NULL);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
fn_exit:
......@@ -1406,7 +1399,6 @@ static inline int perform_cas_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_en
MPIDI_Pkt_init(cas_resp_pkt, MPIDI_CH3_PKT_CAS_RESP_IMMED);
cas_resp_pkt->request_handle = cas_pkt->request_handle;
cas_resp_pkt->source_win_handle = cas_pkt->source_win_handle;
cas_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
cas_resp_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (cas_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
......@@ -1461,7 +1453,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, TRUE /* has response data */,
cas_pkt->flags, cas_pkt->source_win_handle);
cas_pkt->flags, MPI_WIN_NULL);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
fn_exit:
......@@ -1492,7 +1484,8 @@ static inline int perform_op_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_ent
else {
mpi_errno = MPIDI_CH3I_Send_lock_ack_pkt(lock_entry->vc, win_ptr,
MPIDI_CH3_PKT_FLAG_RMA_LOCK_GRANTED,
lock_pkt->source_win_handle);
lock_pkt->source_win_handle,
lock_pkt->request_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
}
......
......@@ -49,7 +49,6 @@ int MPIDI_CH3_ReqHandler_GetSendComplete( MPIDI_VC_t *vc ATTRIBUTE((unused)),
{
int mpi_errno = MPI_SUCCESS;
MPID_Win *win_ptr;
MPI_Win source_win_handle = sreq->dev.source_win_handle;
MPIDI_CH3_Pkt_flags_t flags = sreq->dev.flags;
/* NOTE: It is possible that this request is already completed before
......@@ -85,7 +84,7 @@ int MPIDI_CH3_ReqHandler_GetSendComplete( MPIDI_VC_t *vc ATTRIBUTE((unused)),
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, TRUE /* has response data */,
flags, source_win_handle);
flags, MPI_WIN_NULL);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
*complete = TRUE;
......@@ -106,7 +105,6 @@ int MPIDI_CH3_ReqHandler_GaccumSendComplete( MPIDI_VC_t *vc,
{
int mpi_errno = MPI_SUCCESS;
MPID_Win *win_ptr;
MPI_Win source_win_handle = rreq->dev.source_win_handle;
MPIDI_CH3_Pkt_flags_t flags = rreq->dev.flags;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_GACCUMSENDCOMPLETE);
......@@ -150,7 +148,7 @@ int MPIDI_CH3_ReqHandler_GaccumSendComplete( MPIDI_VC_t *vc,
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, TRUE /* has response data */,
flags, source_win_handle);
flags, MPI_WIN_NULL);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
*complete = TRUE;
......@@ -174,7 +172,6 @@ int MPIDI_CH3_ReqHandler_CASSendComplete( MPIDI_VC_t *vc,
{
int mpi_errno = MPI_SUCCESS;
MPID_Win *win_ptr;
MPI_Win source_win_handle = rreq->dev.source_win_handle;
MPIDI_CH3_Pkt_flags_t flags = rreq->dev.flags;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_CASSENDCOMPLETE);
......@@ -218,7 +215,7 @@ int MPIDI_CH3_ReqHandler_CASSendComplete( MPIDI_VC_t *vc,
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, TRUE/* has response data */,
flags, source_win_handle);
flags, MPI_WIN_NULL);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
*complete = TRUE;
......@@ -240,7 +237,6 @@ int MPIDI_CH3_ReqHandler_FOPSendComplete( MPIDI_VC_t *vc,
{
int mpi_errno = MPI_SUCCESS;
MPID_Win *win_ptr;
MPI_Win source_win_handle = rreq->dev.source_win_handle;
MPIDI_CH3_Pkt_flags_t flags = rreq->dev.flags;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_REQHANDLER_FOPSENDCOMPLETE);
......@@ -284,7 +280,7 @@ int MPIDI_CH3_ReqHandler_FOPSendComplete( MPIDI_VC_t *vc,
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, TRUE /* has response data */,
flags, source_win_handle);
flags, MPI_WIN_NULL);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
*complete = TRUE;
......
......@@ -373,7 +373,6 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype
get_pkt->datatype = target_datatype;
get_pkt->info.dataloop_size = 0;
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (use_immed_resp_pkt)
get_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_IMMED_RESP;
......@@ -747,7 +746,6 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
get_pkt->datatype = target_datatype;
get_pkt->info.dataloop_size = 0;
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (use_immed_resp_pkt == TRUE)
get_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_IMMED_RESP;
......@@ -838,7 +836,6 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count,
get_accum_pkt->info.dataloop_size = 0;
get_accum_pkt->op = op;
get_accum_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_accum_pkt->source_win_handle = win_ptr->handle;
get_accum_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (use_immed_pkt) {
void *src = (void *)origin_addr, *dest = (void *)(get_accum_pkt->info.data);
......@@ -1090,7 +1087,6 @@ int MPIDI_Compare_and_swap(const void *origin_addr, const void *compare_addr,
win_ptr->disp_units[target_rank] * target_disp;
cas_pkt->datatype = datatype;
cas_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
cas_pkt->source_win_handle = win_ptr->handle;
cas_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
/* REQUIRE: All datatype arguments must be of the same, builtin
......@@ -1245,7 +1241,6 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
get_pkt->datatype = datatype;
get_pkt->info.dataloop_size = 0;
get_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
get_pkt->source_win_handle = win_ptr->handle;
get_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (use_immed_resp_pkt == TRUE)
get_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_IMMED_RESP;
......@@ -1293,7 +1288,6 @@ int MPIDI_Fetch_and_op(const void *origin_addr, void *result_addr,
win_ptr->disp_units[target_rank] * target_disp;
fop_pkt->datatype = datatype;
fop_pkt->op = op;
fop_pkt->source_win_handle = win_ptr->handle;
fop_pkt->target_win_handle = win_ptr->all_win_handles[target_rank];
fop_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (use_immed_pkt) {
......
......@@ -382,7 +382,6 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
req = MPID_Request_create();
req->dev.target_win_handle = get_pkt->target_win_handle;
req->dev.source_win_handle = get_pkt->source_win_handle;
req->dev.flags = get_pkt->flags;
/* get start location of data and length of data */
......@@ -424,7 +423,6 @@ int MPIDI_CH3_PktHandler_Get(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
(get_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK))
get_resp_pkt->flags |= MPIDI_CH3_PKT_FLAG_RMA_FLUSH_ACK;
get_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
get_resp_pkt->source_win_handle = get_pkt->source_win_handle;
/* length of target data */
MPID_Datatype_get_size_macro(get_pkt->datatype, type_size);
......@@ -764,7 +762,6 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
resp_req = MPID_Request_create();
resp_req->dev.target_win_handle = get_accum_pkt->target_win_handle;
resp_req->dev.source_win_handle = get_accum_pkt->source_win_handle;
resp_req->dev.flags = get_accum_pkt->flags;
MPIDI_Request_set_type(resp_req, MPIDI_REQUEST_TYPE_GET_ACCUM_RESP);
......@@ -796,7 +793,6 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
get_accum_resp_pkt->request_handle = get_accum_pkt->request_handle;
get_accum_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
get_accum_resp_pkt->source_win_handle = get_accum_pkt->source_win_handle;
get_accum_resp_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (get_accum_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
get_accum_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_EXCLUSIVE)
......@@ -868,7 +864,6 @@ int MPIDI_CH3_PktHandler_GetAccumulate(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
req->dev.op = get_accum_pkt->op;
req->dev.real_user_buf = get_accum_pkt->addr;
req->dev.target_win_handle = get_accum_pkt->target_win_handle;
req->dev.source_win_handle = get_accum_pkt->source_win_handle;
req->dev.flags = get_accum_pkt->flags;
req->dev.resp_request_handle = get_accum_pkt->request_handle;
......@@ -1024,7 +1019,6 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIDI_Pkt_init(cas_resp_pkt, MPIDI_CH3_PKT_CAS_RESP_IMMED);
cas_resp_pkt->request_handle = cas_pkt->request_handle;
cas_resp_pkt->source_win_handle = cas_pkt->source_win_handle;
cas_resp_pkt->target_rank = win_ptr->comm_ptr->rank;
cas_resp_pkt->flags = MPIDI_CH3_PKT_FLAG_NONE;
if (cas_pkt->flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK_SHARED ||
......@@ -1078,7 +1072,7 @@ int MPIDI_CH3_PktHandler_CAS(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
}
mpi_errno = finish_op_on_target(win_ptr, vc, TRUE /* has response data */,
cas_pkt->flags, cas_pkt->source_win_handle);
cas_pkt->flags, MPI_WIN_NULL);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
fn_exit:
......@@ -1113,7 +1107,8 @@ int MPIDI_CH3_PktHandler_CASResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_cas_resp);
MPID_Win_get_ptr(cas_resp_pkt->source_win_handle, win_ptr);
MPID_Request_get_ptr(cas_resp_pkt->request_handle, req);
MPID_Win_get_ptr(req->dev.source_win_handle, win_ptr);