Commit 1e880001 authored by buntinas's avatar buntinas
Browse files

modified rendezvous code to use noncontig function; renamed sendEagerNoncontig to sendNoncontig

parent b0e34f52
......@@ -61,7 +61,7 @@ extern struct MPID_Request *MPIDI_CH3I_active_send[CH3_NUM_QUEUES];
int MPIDI_CH3I_Progress_init(void);
int MPIDI_CH3I_Progress_finalize(void);
int MPIDI_CH3I_SendEagerNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz );
int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz );
int MPID_nem_lmt_shm_initiate_lmt(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *rts_pkt, MPID_Request *req);
int MPID_nem_lmt_shm_start_recv(MPIDI_VC_t *vc, MPID_Request *req, MPID_IOV s_cookie);
......
......@@ -67,7 +67,7 @@ int MPID_nem_newtcp_module_state_listening_handler(pollfd_t *const l_plfd, sockc
int MPID_nem_newtcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz);
int MPID_nem_newtcp_iStartContigMsg(MPIDI_VC_t *vc, void *hdr, MPIDI_msg_sz_t hdr_sz, void *data, MPIDI_msg_sz_t data_sz,
MPID_Request **sreq_ptr);
int MPID_nem_newtcp_SendEagerNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz);
int MPID_nem_newtcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz);
/* Macros */
......
......@@ -318,7 +318,7 @@ int MPID_nem_newtcp_module_vc_init (MPIDI_VC_t *vc, const char *business_card)
/* fprintf(stdout, FCNAME " Enter\n"); fflush(stdout); */
vc_ch->state = MPID_NEM_NEWTCP_MODULE_VC_STATE_DISCONNECTED;
vc->sendEagerNoncontig_fn = MPID_nem_newtcp_SendEagerNoncontig;
vc->sendNoncontig_fn = MPID_nem_newtcp_SendNoncontig;
vc_ch->iStartContigMsg = MPID_nem_newtcp_iStartContigMsg;
vc_ch->iSendContig = MPID_nem_newtcp_iSendContig;
memset(&VC_FIELD(vc, sock_id), 0, sizeof(VC_FIELD(vc, sock_id)));
......
......@@ -445,10 +445,10 @@ int MPID_nem_newtcp_iSendContig(MPIDI_VC_t *vc, MPID_Request *sreq, void *hdr, M
#undef FUNCNAME
#define FUNCNAME MPID_nem_newtcp_SendEagerNoncontig
#define FUNCNAME MPID_nem_newtcp_SendNoncontig
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_newtcp_SendEagerNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz)
int MPID_nem_newtcp_SendNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz)
{
int mpi_errno = MPI_SUCCESS;
int iov_n;
......@@ -457,7 +457,7 @@ int MPID_nem_newtcp_SendEagerNoncontig(MPIDI_VC_t *vc, MPID_Request *sreq, void
MPIDI_msg_sz_t offset;
int complete;
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "newtcp_SendEagerNoncontig");
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "newtcp_SendNoncontig");
MPIU_Assert(hdr_sz <= sizeof(MPIDI_CH3_PktGeneric_t));
iov[0].MPID_IOV_BUF = header;
......
......@@ -630,7 +630,7 @@ MPID_nem_vc_init (MPIDI_VC_t *vc, const char *business_card)
vc_ch->recv_queue = MPID_nem_mem_region.RecvQ[vc->lpid];
/* override nocontig send function */
vc->sendEagerNoncontig_fn = MPIDI_CH3I_SendEagerNoncontig;
vc->sendNoncontig_fn = MPIDI_CH3I_SendNoncontig;
/* local processes use the default method */
vc_ch->iStartContigMsg = NULL;
......@@ -671,10 +671,10 @@ MPID_nem_vc_init (MPIDI_VC_t *vc, const char *business_card)
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
/* FIXME: DARIUS -- enable this assert once these functions are implemented */
/* /\* iStartContigMsg iSendContig and sendEagerNoncontig_fn must */
/* /\* iStartContigMsg iSendContig and sendNoncontig_fn must */
/* be set for nonlocal processes. Default functions only */
/* support shared-memory communication. *\/ */
/* MPIU_Assert(vc_ch->iStartContigMsg && vc_ch->iSendContig && vc->sendEagerNoncontig_fn); */
/* MPIU_Assert(vc_ch->iStartContigMsg && vc_ch->iSendContig && vc->sendNoncontig_fn); */
}
......
......@@ -12,19 +12,19 @@
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3I_SendEagerNoncontig
#define FUNCNAME MPIDI_CH3I_SendNoncontig
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
/* MPIDI_CH3I_SendEagerNoncontig - Sends an eager message by packing
/* MPIDI_CH3I_SendNoncontig - Sends a message by packing
directly into cells. The caller must initialize sreq->dev.segment
as well as segment_first and segment_size. */
int MPIDI_CH3I_SendEagerNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz )
int MPIDI_CH3I_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *header, MPIDI_msg_sz_t hdr_sz )
{
int mpi_errno = MPI_SUCCESS;
int again = 0;
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SENDEAGERNONCONTIG);
MPIDI_STATE_DECL(MPID_STATE_MPIDI_CH3I_SENDNONCONTIG);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SENDEAGERNONCONTIG);
MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SENDNONCONTIG);
MPIDI_DBG_Print_packet((MPIDI_CH3_Pkt_t *)header);
......@@ -88,7 +88,7 @@ int MPIDI_CH3I_SendEagerNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq, void *hea
}
fn_exit:
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SENDEAGERNONCONTIG);
MPIDI_FUNC_EXIT(MPID_STATE_MPIDI_CH3I_SENDNONCONTIG);
return mpi_errno;
fn_fail:
goto fn_exit;
......
......@@ -622,8 +622,8 @@ typedef struct MPIDI_VC
noncontiguous eager message. Caller must initialize
sreq->dev.segment, _first and _size. Contiguous messages are
called directly from CH3 and cannot be overridden. */
int (* sendEagerNoncontig_fn)( struct MPIDI_VC *vc, struct MPID_Request *sreq,
void *header, MPIDI_msg_sz_t hdr_sz );
int (* sendNoncontig_fn)( struct MPIDI_VC *vc, struct MPID_Request *sreq,
void *header, MPIDI_msg_sz_t hdr_sz );
/* Rather than have each channel define its own fields for the
channel-specific data, we provide a fixed-sized scratchpad. Currently,
......@@ -1724,8 +1724,8 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **, const void *, int,
int, int, MPID_Comm *, int );
int MPIDI_CH3_EagerSyncZero(MPID_Request **, int, int, MPID_Comm *, int );
int MPIDI_CH3_SendEagerNoncontig( struct MPIDI_VC *vc, struct MPID_Request *sreq,
void *header, MPIDI_msg_sz_t hdr_sz );
int MPIDI_CH3_SendNoncontig( struct MPIDI_VC *vc, struct MPID_Request *sreq,
void *header, MPIDI_msg_sz_t hdr_sz );
/* Routines to ack packets, called in the receive routines when a
message is matched */
......
......@@ -13,14 +13,14 @@
*/
#undef FUNCNAME
#define FUNCNAME MPIDI_CH3_SendEagerNoncontig
#define FUNCNAME MPIDI_CH3_SendNoncontig
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
/* MPIDI_CH3_SendEagerNoncontig - Sends an eager message by loading an
/* MPIDI_CH3_SendNoncontig - Sends a message by loading an
IOV and calling iSendv. The caller must initialize
sreq->dev.segment as well as segment_first and segment_size. */
int MPIDI_CH3_SendEagerNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq,
void *header, MPIDI_msg_sz_t hdr_sz )
int MPIDI_CH3_SendNoncontig( MPIDI_VC_t *vc, MPID_Request *sreq,
void *header, MPIDI_msg_sz_t hdr_sz )
{
int mpi_errno = MPI_SUCCESS;
int iov_n;
......@@ -117,7 +117,7 @@ int MPIDI_CH3_EagerNoncontigSend( MPID_Request **sreq_p,
sreq->dev.segment_first = 0;
sreq->dev.segment_size = data_sz;
mpi_errno = vc->sendEagerNoncontig_fn(vc, sreq, eager_pkt,
mpi_errno = vc->sendNoncontig_fn(vc, sreq, eager_pkt,
sizeof(MPIDI_CH3_Pkt_eager_send_t));
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......
......@@ -93,8 +93,7 @@ int MPIDI_CH3_EagerSyncNoncontigSend( MPID_Request **sreq_p,
sreq->dev.segment_first = 0;
sreq->dev.segment_size = data_sz;
mpi_errno = vc->sendEagerNoncontig_fn(vc, sreq, es_pkt,
sizeof(MPIDI_CH3_Pkt_eager_sync_send_t));
mpi_errno = vc->sendNoncontig_fn(vc, sreq, es_pkt, sizeof(MPIDI_CH3_Pkt_eager_sync_send_t));
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
......
......@@ -244,8 +244,6 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPI_Aint dt_true_lb;
MPIDI_msg_sz_t data_sz;
MPID_Datatype * dt_ptr;
MPID_IOV iov[MPID_IOV_LIMIT];
int iov_n;
int mpi_errno = MPI_SUCCESS;
MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"received rndv CTS pkt");
......@@ -270,22 +268,27 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
MPIDI_Pkt_init(rs_pkt, MPIDI_CH3_PKT_RNDV_SEND);
rs_pkt->receiver_req_id = cts_pkt->receiver_req_id;
iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rs_pkt;
iov[0].MPID_IOV_LEN = sizeof(*rs_pkt);
MPIDI_Datatype_get_info(sreq->dev.user_count, sreq->dev.datatype, dt_contig, data_sz, dt_ptr, dt_true_lb);
if (dt_contig)
{
MPID_IOV iov[MPID_IOV_LIMIT];
MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
"sending contiguous rndv data, data_sz=" MPIDI_MSG_SZ_FMT,
data_sz));
sreq->dev.OnDataAvail = 0;
iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rs_pkt;
iov[0].MPID_IOV_LEN = sizeof(*rs_pkt);
iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)((char *)sreq->dev.user_buf + dt_true_lb);
iov[1].MPID_IOV_LEN = data_sz;
iov_n = 2;
mpi_errno = MPIU_CALL(MPIDI_CH3,iSendv(vc, sreq, iov, 2));
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|senddata");
}
else
{
......@@ -293,25 +296,12 @@ int MPIDI_CH3_PktHandler_RndvClrToSend( MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt,
/* if (!sreq->dev.segment_ptr) { MPIU_ERR_POP(); } */
MPID_Segment_init(sreq->dev.user_buf, sreq->dev.user_count,
sreq->dev.datatype, sreq->dev.segment_ptr, 0);
iov_n = MPID_IOV_LIMIT - 1;
sreq->dev.segment_first = 0;
sreq->dev.segment_size = data_sz;
/* One the initial load of a send iov req, set the OnFinal action (null
for point-to-point) */
sreq->dev.OnFinal = 0;
mpi_errno = MPIDI_CH3U_Request_load_send_iov(sreq, &iov[1], &iov_n);
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
"**ch3|loadsendiov");
}
iov_n += 1;
}
mpi_errno = MPIU_CALL(MPIDI_CH3,iSendv(vc, sreq, iov, iov_n));
if (mpi_errno != MPI_SUCCESS) {
MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER, "**ch3|senddata");
}
mpi_errno = vc->sendNoncontig_fn(vc, sreq, rs_pkt, sizeof(*rs_pkt));
MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|senddata");
}
*rreqp = NULL;
fn_fail:
......
......@@ -674,7 +674,7 @@ int MPIDI_VC_Init( MPIDI_VC_t *vc, MPIDI_PG_t *pg, int rank )
vc->rndvSend_fn = MPIDI_CH3_RndvSend;
vc->rndvRecv_fn = MPIDI_CH3_RecvRndv;
vc->eager_max_msg_sz = MPIDI_CH3_EAGER_MAX_MSG_SIZE;
vc->sendEagerNoncontig_fn = MPIDI_CH3_SendEagerNoncontig;
vc->sendNoncontig_fn = MPIDI_CH3_SendNoncontig;
MPIU_CALL(MPIDI_CH3,VC_Init( vc ));
MPIU_DBG_PrintVCState(vc);
......
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