int mca_pml_ob1_recv(void *addr, size_t count, ompi_datatype_t * datatype, int src, int tag, struct ompi_communicator_t *comm, ompi_status_public_t * status) { mca_pml_ob1_recv_request_t *recvreq = NULL; int rc; #if !OMPI_ENABLE_THREAD_MULTIPLE recvreq = mca_pml_ob1_recvreq; mca_pml_ob1_recvreq = NULL; if( OPAL_UNLIKELY(NULL == recvreq) ) #endif /* !OMPI_ENABLE_THREAD_MULTIPLE */ { MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq); if (NULL == recvreq) return OMPI_ERR_TEMP_OUT_OF_RESOURCE; } MCA_PML_OB1_RECV_REQUEST_INIT(recvreq, addr, count, datatype, src, tag, comm, false); PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_ACTIVATE, &(recvreq->req_recv.req_base), PERUSE_RECV); MCA_PML_OB1_RECV_REQUEST_START(recvreq); ompi_request_wait_completion(&recvreq->req_recv.req_base.req_ompi); if (NULL != status) { /* return status */ *status = recvreq->req_recv.req_base.req_ompi.req_status; } rc = recvreq->req_recv.req_base.req_ompi.req_status.MPI_ERROR; #if OMPI_ENABLE_THREAD_MULTIPLE MCA_PML_OB1_RECV_REQUEST_RETURN(recvreq); #else if( NULL != mca_pml_ob1_recvreq ) { MCA_PML_OB1_RECV_REQUEST_RETURN(recvreq); } else { mca_pml_ob1_recv_request_fini (recvreq); mca_pml_ob1_recvreq = recvreq; } #endif return rc; }
int mca_pml_ob1_recv(void *addr, size_t count, ompi_datatype_t * datatype, int src, int tag, struct ompi_communicator_t *comm, ompi_status_public_t * status) { mca_pml_ob1_recv_request_t *recvreq = NULL; int rc; if (OPAL_LIKELY(!ompi_mpi_thread_multiple)) { recvreq = mca_pml_ob1_recvreq; mca_pml_ob1_recvreq = NULL; } if( OPAL_UNLIKELY(NULL == recvreq) ) { MCA_PML_OB1_RECV_REQUEST_ALLOC(recvreq); if (NULL == recvreq) return OMPI_ERR_TEMP_OUT_OF_RESOURCE; } recvreq->req_recv.req_base.req_type = MCA_PML_REQUEST_RECV; MCA_PML_OB1_RECV_REQUEST_INIT(recvreq, addr, count, datatype, src, tag, comm, false); PERUSE_TRACE_COMM_EVENT (PERUSE_COMM_REQ_ACTIVATE, &(recvreq->req_recv.req_base), PERUSE_RECV); MCA_PML_OB1_RECV_REQUEST_START(recvreq); ompi_request_wait_completion(&recvreq->req_recv.req_base.req_ompi); if (NULL != status) { /* return status */ *status = recvreq->req_recv.req_base.req_ompi.req_status; } rc = recvreq->req_recv.req_base.req_ompi.req_status.MPI_ERROR; if (OPAL_UNLIKELY(ompi_mpi_thread_multiple || NULL != mca_pml_ob1_recvreq)) { MCA_PML_OB1_RECV_REQUEST_RETURN(recvreq); } else { mca_pml_ob1_recv_request_fini (recvreq); mca_pml_ob1_recvreq = recvreq; } return rc; }