int mca_pml_yalla_mrecv(void *buf, size_t count, ompi_datatype_t *datatype, struct ompi_message_t **message, ompi_status_public_t* status) { mxm_recv_req_t rreq; mxm_error_t error; PML_YALLA_INIT_MXM_RECV_REQ(&rreq, buf, count, datatype, -1, 0, (*message)->comm, recv); PML_YALLA_INIT_BLOCKING_MXM_RECV_REQ(&rreq); PML_YALLA_VERBOSE(8, "receive message *%p=%p dtype %s count %zu", (void *)message, (void *)*message, datatype->name, count); error = mxm_message_recv(&rreq, (*message)->req_ptr); if (MXM_OK != error) { return OMPI_ERROR; } PML_YALLA_MESSAGE_RELEASE(message); PML_YALLA_WAIT_MXM_REQ(&rreq.base); PML_YALLA_VERBOSE(8, "receive completed with status %s source %d rtag %d(%d/0x%x) len %zu", mxm_error_string(rreq.base.error), rreq.completion.sender_imm, rreq.completion.sender_tag, rreq.tag, rreq.tag_mask, rreq.completion.actual_len); PML_YALLA_SET_RECV_STATUS(&rreq, rreq.completion.actual_len, status); return OMPI_SUCCESS; }
int mca_pml_yalla_mprobe(int src, int tag, struct ompi_communicator_t* comm, struct ompi_message_t **message, ompi_status_public_t* status) { mxm_recv_req_t rreq; mxm_message_h mxm_msg; mxm_error_t error; PML_YALLA_INIT_MXM_PROBE_REQ(&rreq, src, tag, comm); for (;;) { error = mxm_req_mprobe(&rreq, &mxm_msg); switch (error) { case MXM_OK: PML_YALLA_SET_RECV_STATUS(&rreq, rreq.completion.sender_len, status); PML_YALLA_SET_MESSAGE(&rreq, comm, mxm_msg, message); return OMPI_SUCCESS; case MXM_ERR_NO_MESSAGE: break; default: return OMPI_ERROR; } opal_progress(); } }
int mca_pml_yalla_recv(void *buf, size_t count, ompi_datatype_t *datatype, int src, int tag, struct ompi_communicator_t* comm, ompi_status_public_t* status) { mxm_recv_req_t rreq; mxm_error_t error; PML_YALLA_INIT_MXM_RECV_REQ(&rreq, buf, count, datatype, src, tag, comm, recv); PML_YALLA_INIT_BLOCKING_MXM_RECV_REQ(&rreq); PML_YALLA_VERBOSE(8, "receive from %d tag %d dtype %s count %zu", src, tag, datatype->name, count); error = mxm_req_recv(&rreq); if (MXM_OK != error) { return OMPI_ERROR; } PML_YALLA_WAIT_MXM_REQ(&rreq.base); PML_YALLA_VERBOSE(8, "receive completed with status %s source %d rtag %d(%d/0x%x) len %zu", mxm_error_string(rreq.base.error), rreq.completion.sender_imm, rreq.completion.sender_tag, rreq.tag, rreq.tag_mask, rreq.completion.actual_len); PML_YALLA_SET_RECV_STATUS(&rreq, rreq.completion.actual_len, status); PML_YALLA_FREE_BLOCKING_MXM_REQ(&rreq.base); return OMPI_SUCCESS; }
static void mca_pml_yalla_recv_completion_cb(void *context) { mca_pml_yalla_recv_request_t* rreq = context; PML_YALLA_SET_RECV_STATUS(&rreq->mxm, rreq->mxm.completion.actual_len, &rreq->super.ompi.req_status); PML_YALLA_VERBOSE(8, "receive request %p completed with status %s source %d rtag %d(%d/0x%x) len %zu", (void *)rreq, mxm_error_string(rreq->mxm.base.error), rreq->mxm.completion.sender_imm, rreq->mxm.completion.sender_tag, rreq->mxm.tag, rreq->mxm.tag_mask, rreq->mxm.completion.actual_len); ompi_request_complete(&rreq->super.ompi, true); if (rreq->super.flags & MCA_PML_YALLA_REQUEST_FLAG_FREE_CALLED) { PML_YALLA_VERBOSE(7, "release request %p because free was already called", (void *)rreq); mca_pml_yalla_request_release(&rreq->super, &ompi_pml_yalla.recv_reqs); } }
int mca_pml_yalla_iprobe(int src, int tag, struct ompi_communicator_t* comm, int *matched, ompi_status_public_t* status) { mxm_recv_req_t rreq; mxm_error_t error; PML_YALLA_INIT_MXM_PROBE_REQ(&rreq, src, tag, comm); error = mxm_req_probe(&rreq); switch (error) { case MXM_OK: *matched = 1; PML_YALLA_SET_RECV_STATUS(&rreq, rreq.completion.sender_len, status); return OMPI_SUCCESS; case MXM_ERR_NO_MESSAGE: *matched = 0; return OMPI_SUCCESS; default: return OMPI_ERROR; } return OMPI_SUCCESS; }