Create function to specifically initialize the header depending on the communication type.
This commit was SVN r3625.
Этот коммит содержится в:
родитель
af1f8e485a
Коммит
394e5abd04
@ -81,25 +81,13 @@ extern "C" {
|
||||
int flags );
|
||||
|
||||
static inline int
|
||||
mca_ptl_gm_send_frag_init( struct mca_ptl_gm_send_frag_t* sendfrag,
|
||||
struct mca_ptl_gm_peer_t * ptl_peer,
|
||||
mca_ptl_gm_init_header_match( struct mca_ptl_gm_send_frag_t* sendfrag,
|
||||
struct mca_pml_base_send_request_t * sendreq,
|
||||
size_t offset,
|
||||
size_t* size,
|
||||
int flags )
|
||||
|
||||
{
|
||||
mca_ptl_base_header_t *hdr = (mca_ptl_base_header_t *)sendfrag->send_buf;
|
||||
|
||||
sendfrag->status = -1;
|
||||
sendfrag->type = -1;
|
||||
sendfrag->wait_for_ack = 0;
|
||||
sendfrag->put_sent = -1;
|
||||
sendfrag->send_complete = -1;
|
||||
|
||||
hdr->hdr_common.hdr_flags = flags;
|
||||
if (offset == 0) {
|
||||
/* When the offset is ZERO we send the match header. */
|
||||
hdr->hdr_common.hdr_type = MCA_PTL_HDR_TYPE_MATCH;
|
||||
|
||||
hdr->hdr_match.hdr_contextid = sendreq->req_base.req_comm->c_contextid;
|
||||
@ -109,16 +97,29 @@ extern "C" {
|
||||
hdr->hdr_match.hdr_msg_length = sendreq->req_bytes_packed;
|
||||
hdr->hdr_match.hdr_msg_seq = sendreq->req_base.req_sequence;
|
||||
sendfrag->type = MATCH;
|
||||
} else {
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
static inline int
|
||||
mca_ptl_gm_init_header_frag( struct mca_ptl_gm_send_frag_t* sendfrag,
|
||||
struct mca_ptl_gm_peer_t * ptl_peer,
|
||||
struct mca_pml_base_send_request_t * sendreq,
|
||||
size_t offset,
|
||||
size_t* size,
|
||||
int flags )
|
||||
|
||||
{
|
||||
mca_ptl_base_header_t *hdr = (mca_ptl_base_header_t *)sendfrag->send_buf;
|
||||
|
||||
hdr->hdr_common.hdr_flags = flags;
|
||||
hdr->hdr_common.hdr_type = MCA_PTL_HDR_TYPE_FRAG;
|
||||
hdr->hdr_frag.hdr_frag_offset = offset;
|
||||
hdr->hdr_frag.hdr_frag_length = *size;
|
||||
hdr->hdr_frag.hdr_src_ptr.lval = 0;
|
||||
hdr->hdr_frag.hdr_src_ptr.pval = sendfrag; /* pointer to the frag */
|
||||
hdr->hdr_frag.hdr_dst_ptr = sendreq->req_peer_match;
|
||||
|
||||
sendfrag->type = FRAG;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user