1
1

Create function to specifically initialize the header depending on the communication type.

This commit was SVN r3625.
Этот коммит содержится в:
George Bosilca 2004-11-18 20:20:42 +00:00
родитель af1f8e485a
Коммит 394e5abd04

Просмотреть файл

@ -81,44 +81,45 @@ 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,
struct mca_pml_base_send_request_t * sendreq,
size_t offset,
size_t* size,
int flags )
mca_ptl_gm_init_header_match( struct mca_ptl_gm_send_frag_t* sendfrag,
struct mca_pml_base_send_request_t * sendreq,
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_MATCH;
hdr->hdr_match.hdr_contextid = sendreq->req_base.req_comm->c_contextid;
hdr->hdr_match.hdr_src = sendreq->req_base.req_comm->c_my_rank;
hdr->hdr_match.hdr_dst = sendreq->req_base.req_peer;
hdr->hdr_match.hdr_tag = sendreq->req_base.req_tag;
hdr->hdr_match.hdr_msg_length = sendreq->req_bytes_packed;
hdr->hdr_match.hdr_msg_seq = sendreq->req_base.req_sequence;
sendfrag->type = MATCH;
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;
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;
hdr->hdr_match.hdr_src = sendreq->req_base.req_comm->c_my_rank;
hdr->hdr_match.hdr_dst = sendreq->req_base.req_peer;
hdr->hdr_match.hdr_tag = sendreq->req_base.req_tag;
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 {
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;
}
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;
}