Commit e36203c3 authored by Xin Zhao's avatar Xin Zhao
Browse files

Change routine/pkt name from LOCK_GRANTED to LOCK_ACK

Because we will send different kinds of LOCK ACKs (not
just LOCK_GRANTED, but maybe LOCK_DISCARDED, for example),
so naming related packets and function as "LOCK_GRANTED"
is not proper anymore. Here we rename them to "LOCK_ACK".

No reviewer.
parent 385f0aae
......@@ -1824,7 +1824,7 @@ int MPIDI_CH3_PktHandler_GetResp( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_Lock( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_LockGranted( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
int MPIDI_CH3_PktHandler_LockAck( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
int MPIDI_CH3_PktHandler_Unlock( MPIDI_VC_t *, MPIDI_CH3_Pkt_t *,
MPIDI_msg_sz_t *, MPID_Request ** );
......
......@@ -89,7 +89,7 @@ typedef enum {
MPIDI_CH3_PKT_UNLOCK,
MPIDI_CH3_PKT_FLUSH,
MPIDI_CH3_PKT_DECR_AT_COUNTER,
MPIDI_CH3_PKT_LOCK_GRANTED,
MPIDI_CH3_PKT_LOCK_ACK,
MPIDI_CH3_PKT_FLUSH_ACK,
/* RMA Packets end here */
MPIDI_CH3_PKT_FLOW_CNTL_UPDATE, /* FIXME: Unused */
......@@ -638,15 +638,15 @@ typedef struct MPIDI_CH3_Pkt_decr_at_counter {
} MPIDI_CH3_Pkt_decr_at_counter_t;
/*********************************************************************************/
/* RMA control response packet (from target to origin, including LOCK_GRANTED, */
/* RMA control response packet (from target to origin, including LOCK_ACK, */
/* FLUSH_ACK) */
/*********************************************************************************/
typedef struct MPIDI_CH3_Pkt_lock_granted {
typedef struct MPIDI_CH3_Pkt_lock_ack {
MPIDI_CH3_Pkt_type_t type;
MPI_Win source_win_handle;
int target_rank;
} MPIDI_CH3_Pkt_lock_granted_t;
} MPIDI_CH3_Pkt_lock_ack_t;
typedef struct MPIDI_CH3_Pkt_flush_ack {
MPIDI_CH3_Pkt_type_t type;
......@@ -696,7 +696,7 @@ typedef union MPIDI_CH3_Pkt {
MPIDI_CH3_Pkt_unlock_t unlock;
MPIDI_CH3_Pkt_flush_t flush;
MPIDI_CH3_Pkt_decr_at_counter_t decr_at_cnt;
MPIDI_CH3_Pkt_lock_granted_t lock_granted;
MPIDI_CH3_Pkt_lock_ack_t lock_ack;
MPIDI_CH3_Pkt_flush_ack_t flush_ack;
/* RMA packets end here */
MPIDI_CH3_Pkt_close_t close;
......
......@@ -100,30 +100,30 @@ static inline int send_unlock_msg(int dest, MPID_Win * win_ptr,
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_Send_lock_granted_pkt
#define FUNCNAME MPIDI_CH3I_Send_lock_ack_pkt
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
static inline int MPIDI_CH3I_Send_lock_granted_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr, MPI_Win source_win_handle)
static inline int MPIDI_CH3I_Send_lock_ack_pkt(MPIDI_VC_t * vc, MPID_Win * win_ptr, MPI_Win source_win_handle)
{
MPIDI_CH3_Pkt_t upkt;
MPIDI_CH3_Pkt_lock_granted_t *lock_granted_pkt = &upkt.lock_granted;
MPIDI_CH3_Pkt_lock_ack_t *lock_ack_pkt = &upkt.lock_ack;
MPID_Request *req = NULL;
int mpi_errno;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SEND_LOCK_GRANTED_PKT);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SEND_LOCK_ACK_PKT);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_LOCK_GRANTED_PKT);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_LOCK_ACK_PKT);
/* send lock granted packet */
MPIDI_Pkt_init(lock_granted_pkt, MPIDI_CH3_PKT_LOCK_GRANTED);
lock_granted_pkt->source_win_handle = source_win_handle;
lock_granted_pkt->target_rank = win_ptr->comm_ptr->rank;
/* 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->target_rank = win_ptr->comm_ptr->rank;
MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE,
(MPIU_DBG_FDEST, "sending lock granted pkt on vc=%p, source_win_handle=%#08x",
vc, lock_granted_pkt->source_win_handle));
(MPIU_DBG_FDEST, "sending lock ack pkt on vc=%p, source_win_handle=%#08x",
vc, lock_ack_pkt->source_win_handle));
MPIU_THREAD_CS_ENTER(CH3COMM, vc);
mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_granted_pkt, sizeof(*lock_granted_pkt), &req);
mpi_errno = MPIDI_CH3_iStartMsg(vc, lock_ack_pkt, sizeof(*lock_ack_pkt), &req);
MPIU_THREAD_CS_EXIT(CH3COMM, vc);
if (mpi_errno) {
MPIU_ERR_SETANDJUMP(mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg");
......@@ -134,7 +134,7 @@ static inline int MPIDI_CH3I_Send_lock_granted_pkt(MPIDI_VC_t * vc, MPID_Win * w
}
fn_fail:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SEND_LOCK_GRANTED_PKT);
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SEND_LOCK_ACK_PKT);
return mpi_errno;
}
......@@ -632,7 +632,7 @@ static inline int finish_op_on_target(MPID_Win *win_ptr, MPIDI_VC_t *vc,
if (flags & MPIDI_CH3_PKT_FLAG_RMA_LOCK) {
if (!(flags & MPIDI_CH3_PKT_FLAG_RMA_FLUSH) &&
!(flags & MPIDI_CH3_PKT_FLAG_RMA_UNLOCK)) {
mpi_errno = MPIDI_CH3I_Send_lock_granted_pkt(vc, win_ptr, source_win_handle);
mpi_errno = MPIDI_CH3I_Send_lock_ack_pkt(vc, win_ptr, source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
MPIDI_CH3_Progress_signal_completion();
}
......
......@@ -579,8 +579,8 @@ int MPIDI_CH3_PktHandler_Init( MPIDI_CH3_PktHandler_Fcn *pktArray[],
MPIDI_CH3_PktHandler_GetResp;
pktArray[MPIDI_CH3_PKT_LOCK] =
MPIDI_CH3_PktHandler_Lock;
pktArray[MPIDI_CH3_PKT_LOCK_GRANTED] =
MPIDI_CH3_PktHandler_LockGranted;
pktArray[MPIDI_CH3_PKT_LOCK_ACK] =
MPIDI_CH3_PktHandler_LockAck;
pktArray[MPIDI_CH3_PKT_UNLOCK] =
MPIDI_CH3_PktHandler_Unlock;
pktArray[MPIDI_CH3_PKT_FLUSH] =
......
......@@ -1305,7 +1305,7 @@ static inline int perform_op_in_lock_queue(MPID_Win *win_ptr, MPIDI_RMA_Lock_ent
MPIDI_VC_t *vc = NULL;
MPIDI_Comm_get_vc_set_active(win_ptr->comm_ptr,
lock_pkt->origin_rank, &vc);
mpi_errno = MPIDI_CH3I_Send_lock_granted_pkt(vc, win_ptr,
mpi_errno = MPIDI_CH3I_Send_lock_ack_pkt(vc, win_ptr,
lock_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
......
......@@ -18,7 +18,7 @@ MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_get_accum_resp);
MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_cas_resp);
MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_fop_resp);
MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_lock);
MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_lock_granted);
MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_lock_ack);
MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_unlock);
MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_flush);
MPIR_T_PVAR_DOUBLE_TIMER_DECL(RMA, rma_rmapkt_flush_ack);
......@@ -128,11 +128,11 @@ void MPIDI_CH3_RMA_Init_pkthandler_pvars(void)
/* rma_rmapkt_lock_granted */
MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
MPI_DOUBLE,
rma_rmapkt_lock_granted,
rma_rmapkt_lock_ack,
MPI_T_VERBOSITY_MPIDEV_DETAIL,
MPI_T_BIND_NO_OBJECT,
MPIR_T_PVAR_FLAG_READONLY,
"RMA", "RMA:PKTHANDLER for Lock-Granted (in seconds)");
"RMA", "RMA:PKTHANDLER for Lock-Ack (in seconds)");
/* rma_rmapkt_unlock */
MPIR_T_PVAR_TIMER_REGISTER_STATIC(RMA,
......@@ -1328,7 +1328,7 @@ int MPIDI_CH3_PktHandler_Lock(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_pkt->lock_type) == 1) {
/* send lock granted packet. */
mpi_errno = MPIDI_CH3I_Send_lock_granted_pkt(vc, win_ptr, lock_pkt->source_win_handle);
mpi_errno = MPIDI_CH3I_Send_lock_ack_pkt(vc, win_ptr, lock_pkt->source_win_handle);
if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno);
}
......@@ -1441,27 +1441,27 @@ int MPIDI_CH3_PktHandler_GetResp(MPIDI_VC_t * vc ATTRIBUTE((unused)),
}
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3_PktHandler_LockGranted
#define FUNCNAME MPIDI_CH3_PktHandler_LockAck
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPIDI_CH3_PktHandler_LockGranted(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
int MPIDI_CH3_PktHandler_LockAck(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
MPIDI_msg_sz_t * buflen, MPID_Request ** rreqp)
{
MPIDI_CH3_Pkt_lock_granted_t *lock_granted_pkt = &pkt->lock_granted;
MPIDI_CH3_Pkt_lock_ack_t *lock_ack_pkt = &pkt->lock_ack;
MPID_Win *win_ptr = NULL;
int target_rank = lock_granted_pkt->target_rank;
int target_rank = lock_ack_pkt->target_rank;
int mpi_errno = MPI_SUCCESS;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGRANTED);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKACK);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGRANTED);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKACK);
MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock granted pkt");
MPIU_DBG_MSG(CH3_OTHER, VERBOSE, "received lock ack pkt");
MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_lock_granted);
MPIR_T_PVAR_TIMER_START(RMA, rma_rmapkt_lock_ack);
*buflen = sizeof(MPIDI_CH3_Pkt_t);
MPID_Win_get_ptr(lock_granted_pkt->source_win_handle, win_ptr);
MPID_Win_get_ptr(lock_ack_pkt->source_win_handle, win_ptr);
mpi_errno = set_lock_sync_counter(win_ptr, target_rank);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......@@ -1469,8 +1469,8 @@ int MPIDI_CH3_PktHandler_LockGranted(MPIDI_VC_t * vc, MPIDI_CH3_Pkt_t * pkt,
*rreqp = NULL;
MPIDI_CH3_Progress_signal_completion();
MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_lock_granted);
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKGRANTED);
MPIR_T_PVAR_TIMER_END(RMA, rma_rmapkt_lock_ack);
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3_PKTHANDLER_LOCKACK);
fn_exit:
return MPI_SUCCESS;
fn_fail:
......@@ -1712,10 +1712,10 @@ int MPIDI_CH3_PktPrint_FlushAck(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
return MPI_SUCCESS;
}
int MPIDI_CH3_PktPrint_LockGranted(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
int MPIDI_CH3_PktPrint_LockAck(FILE * fp, MPIDI_CH3_Pkt_t * pkt)
{
MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_LOCK_GRANTED\n"));
MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->lock_granted.source_win_handle));
MPIU_DBG_PRINTF((" type ......... MPIDI_CH3_PKT_LOCK_ACK\n"));
MPIU_DBG_PRINTF((" source ....... 0x%08X\n", pkt->lock_ack.source_win_handle));
return MPI_SUCCESS;
}
#endif
......@@ -146,8 +146,8 @@ void MPIDI_DBG_Print_packet(MPIDI_CH3_Pkt_t *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 );
case MPIDI_CH3_PKT_LOCK_ACK:
MPIDI_CH3_PktPrint_LockAck( stdout, pkt );
break;
/*
case MPIDI_CH3_PKT_SHARED_LOCK_OPS_DONE:
......@@ -339,10 +339,10 @@ const char *MPIDI_Pkt_GetDescString( MPIDI_CH3_Pkt_t *pkt )
"RMA_DONE - 0x%08X",
pkt->flush_ack.source_win_handle );
break;
case MPIDI_CH3_PKT_LOCK_GRANTED:
case MPIDI_CH3_PKT_LOCK_ACK:
MPIU_Snprintf( pktmsg, sizeof(pktmsg),
"LOCK_GRANTED - 0x%08X",
pkt->lock_granted.source_win_handle );
"LOCK_ACK - 0x%08X",
pkt->lock_ack.source_win_handle );
break;
case MPIDI_CH3_PKT_FLOW_CNTL_UPDATE:
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