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

Rename ACK packets in RMA.



The packet type MPIDI_CH3_PKT_PT_RMA_DONE is used for ACK
of FLUSH / UNLOCK packets. Here we rename it to
MPIDI_CH3_PKT_FLUSH_ACK and modify the related functions
and data structures.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 0eaf344b
......@@ -1809,7 +1809,7 @@ int MPIDI_CH3_PktHandler_Unlock( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_Flush( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_PtRMADone( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
int MPIDI_CH3_PktHandler_FlushAck( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_LockPutUnlock( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
......
......@@ -88,7 +88,7 @@ typedef enum {
MPIDI_CH3_PKT_LOCK_GRANTED,
MPIDI_CH3_PKT_UNLOCK,
MPIDI_CH3_PKT_FLUSH,
MPIDI_CH3_PKT_PT_RMA_DONE,
MPIDI_CH3_PKT_FLUSH_ACK,
MPIDI_CH3_PKT_LOCK_PUT_UNLOCK, /* optimization for single puts */
MPIDI_CH3_PKT_LOCK_GET_UNLOCK, /* optimization for single gets */
MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK, /* optimization for single accumulates */
......@@ -326,11 +326,11 @@ typedef struct MPIDI_CH3_Pkt_lock {
typedef struct MPIDI_CH3_Pkt_lock_granted {
MPIDI_CH3_Pkt_type_t type;
MPI_Win source_win_handle;
int target_rank; /* Used in pt_rma_done response to look up the
int target_rank; /* Used in flush_ack response to look up the
* target state at the origin. */
} MPIDI_CH3_Pkt_lock_granted_t;
typedef MPIDI_CH3_Pkt_lock_granted_t MPIDI_CH3_Pkt_pt_rma_done_t;
typedef MPIDI_CH3_Pkt_lock_granted_t MPIDI_CH3_Pkt_flush_ack_t;
typedef MPIDI_CH3_Pkt_lock_t MPIDI_CH3_Pkt_unlock_t;
typedef MPIDI_CH3_Pkt_lock_t MPIDI_CH3_Pkt_flush_t;
......@@ -406,7 +406,7 @@ typedef union MPIDI_CH3_Pkt {
MPIDI_CH3_Pkt_lock_granted_t lock_granted;
MPIDI_CH3_Pkt_unlock_t unlock;
MPIDI_CH3_Pkt_flush_t flush;
MPIDI_CH3_Pkt_pt_rma_done_t pt_rma_done;
MPIDI_CH3_Pkt_flush_ack_t flush_ack;
MPIDI_CH3_Pkt_lock_put_unlock_t lock_put_unlock;
MPIDI_CH3_Pkt_lock_get_unlock_t lock_get_unlock;
MPIDI_CH3_Pkt_lock_accum_unlock_t lock_accum_unlock;
......
......@@ -150,27 +150,27 @@ static inline int MPIDI_CH3I_Send_lock_granted_pkt(MPIDI_VC_t * vc, MPID_Win * w
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_Send_pt_rma_done_pkt
#define FUNCNAME MPIDI_CH3I_Send_flush_ack_pkt
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline int MPIDI_CH3I_Send_pt_rma_done_pkt(MPIDI_VC_t *vc, MPID_Win *win_ptr,
static inline int MPIDI_CH3I_Send_flush_ack_pkt(MPIDI_VC_t *vc, MPID_Win *win_ptr,
MPI_Win source_win_handle)
{
MPIDI_CH3_Pkt_t upkt;
MPIDI_CH3_Pkt_pt_rma_done_t *pt_rma_done_pkt = &upkt.pt_rma_done;
MPIDI_CH3_Pkt_flush_ack_t *flush_ack_pkt = &upkt.flush_ack;
MPID_Request *req;
int mpi_errno=MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SEND_PT_RMA_DONE_PKT);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SEND_FLUSH_ACK_PKT);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_PT_RMA_DONE_PKT);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_FLUSH_ACK_PKT);
MPIDI_Pkt_init(pt_rma_done_pkt, MPIDI_CH3_PKT_PT_RMA_DONE);
pt_rma_done_pkt->source_win_handle = source_win_handle;
pt_rma_done_pkt->target_rank = win_ptr->comm_ptr->rank;
MPIDI_Pkt_init(flush_ack_pkt, MPIDI_CH3_PKT_FLUSH_ACK);
flush_ack_pkt->source_win_handle = source_win_handle;
flush_ack_pkt->target_rank = win_ptr->comm_ptr->rank;
/* Because this is in a packet handler, it is already within a critical section */
/* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */
mpi_errno = MPIDI_CH3_iStartMsg(vc, pt_rma_done_pkt, sizeof(*pt_rma_done_pkt), &req);
mpi_errno = MPIDI_CH3_iStartMsg(vc, flush_ack_pkt, sizeof(*flush_ack_pkt), &req);
/* MPIU_THREAD_CS_EXIT(CH3COMM,vc); */
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|rmamsg");
......@@ -182,7 +182,7 @@ static inline int MPIDI_CH3I_Send_pt_rma_done_pkt(MPIDI_VC_t *vc, MPID_Win *win_
}
fn_fail:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SEND_PT_RMA_DONE_PKT);
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SEND_FLUSH_ACK_PKT);
return mpi_errno;
}
......
......@@ -586,8 +586,8 @@ int MPIDI_CH3_PktHandler_Init( MPIDI_CH3_PktHandler_Fcn *pktArray[],
MPIDI_CH3_PktHandler_Unlock;
pktArray[MPIDI_CH3_PKT_FLUSH] =
MPIDI_CH3_PktHandler_Flush;
pktArray[MPIDI_CH3_PKT_PT_RMA_DONE] =
MPIDI_CH3_PktHandler_PtRMADone;
pktArray[MPIDI_CH3_PKT_FLUSH_ACK] =
MPIDI_CH3_PktHandler_FlushAck;
pktArray[MPIDI_CH3_PKT_LOCK_PUT_UNLOCK] =
MPIDI_CH3_PktHandler_LockPutUnlock;
pktArray[MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK] =
......
......@@ -936,7 +936,7 @@ int MPIDI_CH3I_Release_lock(MPID_Win *win_ptr)
MPIDI_VC_t *vc;
MPIDI_Comm_get_vc(win_ptr->comm_ptr, lock_queue->origin_rank, &vc);
mpi_errno =
MPIDI_CH3I_Send_pt_rma_done_pkt(vc, win_ptr,
MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr,
lock_queue->source_win_handle);
if (mpi_errno) { MPIU_ERR_POP(mpi_errno); }
......
......@@ -1363,37 +1363,38 @@ int MPIDI_CH3_PktHandler_LockGranted(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
}
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3_PktHandler_PtRMADone
#define FUNCNAME MPIDI_CH3_PktHandler_FlushAck
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_CH3_PktHandler_PtRMADone(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
int MPIDI_CH3_PktHandler_FlushAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
{
MPIDI_CH3_Pkt_pt_rma_done_t *pt_rma_done_pkt = &pkt->pt_rma_done;
MPIDI_CH3_Pkt_flush_ack_t *flush_ack_pkt = &pkt->flush_ack;
MPID_Win *win_ptr = NULL;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_PTRMADONE);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSHACK);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_PTRMADONE);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSHACK);
MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received shared lock ops done pkt");
*buflen = sizeof(MPIDI_CH3_Pkt_t);
MPID_Win_get_ptr(pt_rma_done_pkt->source_win_handle, win_ptr);
MPIU_Assert(win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state !=
MPID_Win_get_ptr(flush_ack_pkt->source_win_handle, win_ptr);
MPIU_Assert(win_ptr->targets[flush_ack_pkt->target_rank].remote_lock_state !=
MPIDI_CH3_WIN_LOCK_NONE);
if (win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state ==
if (win_ptr->targets[flush_ack_pkt->target_rank].remote_lock_state ==
MPIDI_CH3_WIN_LOCK_FLUSH)
win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state =
win_ptr->targets[flush_ack_pkt->target_rank].remote_lock_state =
MPIDI_CH3_WIN_LOCK_GRANTED;
else
win_ptr->targets[pt_rma_done_pkt->target_rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_NONE;
win_ptr->targets[flush_ack_pkt->target_rank].remote_lock_state = MPIDI_CH3_WIN_LOCK_NONE;
*rreqp = NULL;
MPIDI_CH3_Progress_signal_completion();
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_PTRMADONE);
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_FLUSHACK);
fn_exit:
return MPI_SUCCESS;
}
......@@ -1565,7 +1566,7 @@ int MPIDI_CH3_Finish_rma_op_target(MPIDI_VC_t * vc, MPID_Win * win_ptr, int is_r
if (flags & MPIDI_CH3_PKT_FLAG_RMA_REQ_ACK) {
MPIU_Assert(source_win_handle != MPI_WIN_NULL && vc != NULL);
mpi_errno = MPIDI_CH3I_Send_pt_rma_done_pkt(vc, win_ptr, source_win_handle);
mpi_errno = MPIDI_CH3I_Send_flush_ack_pkt(vc, win_ptr, source_win_handle);
if (mpi_errno) {
MPIU_ERR_POP(mpi_errno);
}
......@@ -1740,9 +1741,9 @@ int MPIDI_CH3_PktPrint_LockGetUnlock(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
return MPI_SUCCESS;
}
int MPIDI_CH3_PktPrint_PtRMADone(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
int MPIDI_CH3_PktPrint_FlushAck(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
{
MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_PT_RMA_DONE\n"));
MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_FLUSH_ACK\n"));
MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->lock_accum_unlock.source_win_handle));
return MPI_SUCCESS;
}
......
......@@ -152,8 +152,8 @@ void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t *pkt)
case MPIDI_CH3_PKT_LOCK_GET_UNLOCK:
MPIDI_CH3_PktPrint_LockGetUnlock( stdout, pkt );
break;
case MPIDI_CH3_PKT_PT_RMA_DONE:
MPIDI_CH3_PktPrint_PtRMADone( stdout, pkt );
case MPIDI_CH3_PKT_FLUSH_ACK:
MPIDI_CH3_PktPrint_FlushAck( stdout, pkt );
break;
case MPIDI_CH3_PKT_LOCK_GRANTED:
MPIDI_CH3_PktPrint_LockGranted( stdout, pkt );
......@@ -364,11 +364,11 @@ const char *MPIDI_Pkt_GetDescString( MPIDI_CH3_Pkt_t *pkt )
pkt->lock_get_unlock.target_win_handle,
pkt->lock_get_unlock.request_handle );
break;
case MPIDI_CH3_PKT_PT_RMA_DONE:
case MPIDI_CH3_PKT_FLUSH_ACK:
/* There is no rma_done packet type */
MPIU_Snprintf( pktmsg, sizeof(pktmsg),
"RMA_DONE - 0x%08X",
pkt->lock_accum_unlock.source_win_handle );
pkt->flush_ack.source_win_handle );
break;
case MPIDI_CH3_PKT_LOCK_GRANTED:
MPIU_Snprintf( pktmsg, sizeof(pktmsg),
......
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