diff --git a/ompi/mca/pml/base/pml_base_bsend.c b/ompi/mca/pml/base/pml_base_bsend.c index 874db04bd5..46ec9af242 100644 --- a/ompi/mca/pml/base/pml_base_bsend.c +++ b/ompi/mca/pml/base/pml_base_bsend.c @@ -243,7 +243,7 @@ int mca_pml_base_bsend_request_start(ompi_request_t* request) /* increment count of pending requests */ mca_pml_bsend_count++; } - sendreq->req_base.req_ompi.req_complete = true; + return OMPI_SUCCESS; } diff --git a/ompi/mca/pml/cm/pml_cm_send.c b/ompi/mca/pml/cm/pml_cm_send.c index 9cff1cbfa9..4b767cae27 100644 --- a/ompi/mca/pml/cm/pml_cm_send.c +++ b/ompi/mca/pml/cm/pml_cm_send.c @@ -89,16 +89,21 @@ mca_pml_cm_send(void *buf, datatype, dst, tag, comm, sendmode, true, false); - if (sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED || - NULL == ompi_mtl->mtl_send) { + if (sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED ) { MCA_PML_CM_SEND_REQUEST_START(sendreq, ret); if (OMPI_SUCCESS != ret) { MCA_PML_CM_SEND_REQUEST_RETURN(sendreq); return ret; } - + } else if (NULL == ompi_mtl->mtl_send) { + MCA_PML_CM_SEND_REQUEST_START(sendreq, ret); + if (OMPI_SUCCESS != ret) { + MCA_PML_CM_SEND_REQUEST_RETURN(sendreq); + return ret; + } + if (sendreq->req_send.req_base.req_ompi.req_complete == false) { - /* give up and sleep until completion */ + /* give up and sleep until completion */ if (opal_using_threads()) { opal_mutex_lock(&ompi_request_lock); ompi_request_waiting++; diff --git a/ompi/mca/pml/cm/pml_cm_sendreq.h b/ompi/mca/pml/cm/pml_cm_sendreq.h index a896e88c7e..84fff15647 100644 --- a/ompi/mca/pml/cm/pml_cm_sendreq.h +++ b/ompi/mca/pml/cm/pml_cm_sendreq.h @@ -110,8 +110,12 @@ do { \ sendreq->req_send.req_send_mode, \ sendreq->req_blocking, \ &sendreq->req_mtl)); \ + if(OMPI_SUCCESS == ret && \ + sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) { \ + MCA_PML_CM_SEND_REQUEST_MPI_COMPLETE(sendreq); \ + } \ } \ - } while (0) +} while (0) /*