static int send_ep_address(void) { mxm_error_t error; void *address; size_t addrlen; int rc; addrlen = 0; error = mxm_ep_get_address(ompi_pml_yalla.mxm_ep, NULL, &addrlen); PML_YALLA_ASSERT(error == MXM_ERR_BUFFER_TOO_SMALL); address = alloca(addrlen); error = mxm_ep_get_address(ompi_pml_yalla.mxm_ep, address, &addrlen); if (MXM_OK != error) { PML_YALLA_ERROR("Failed to get EP address"); return OMPI_ERROR; } OPAL_MODEX_SEND(rc, PMIX_SYNC_REQD, PMIX_GLOBAL, &mca_pml_yalla_component.pmlm_version, address, addrlen); if (OMPI_SUCCESS != rc) { PML_YALLA_ERROR("Open MPI couldn't distribute EP connection details"); return OMPI_ERROR; } return OMPI_SUCCESS; }
static int send_ep_address(void) { mxm_error_t error; void *address; size_t addrlen; int rc; addrlen = 0; mxm_ep_get_address(ompi_pml_yalla.mxm_ep, NULL, &addrlen); address = alloca(addrlen); error = mxm_ep_get_address(ompi_pml_yalla.mxm_ep, address, &addrlen); if (MXM_OK != error) { PML_YALLA_ERROR("Failed to get EP address"); return OMPI_ERROR; } rc = ompi_modex_send(&mca_pml_yalla_component.pmlm_version, address, addrlen); if (OMPI_SUCCESS != rc) { PML_YALLA_ERROR("Open MPI couldn't distribute EP connection details"); return OMPI_ERROR; } return OMPI_SUCCESS; }
static int recv_ep_address(ompi_proc_t *proc, void **address_p, size_t *addrlen_p) { int ret = ompi_modex_recv(&mca_pml_yalla_component.pmlm_version, proc, address_p, addrlen_p); if (ret < 0) { PML_YALLA_ERROR("Failed to receive EP address"); } return ret; }
static int recv_ep_address(ompi_proc_t *proc, void **address_p, size_t *addrlen_p) { int rc; OPAL_MODEX_RECV(rc, &mca_pml_yalla_component.pmlm_version, &proc->super, address_p, addrlen_p); if (rc < 0) { PML_YALLA_ERROR("Failed to receive EP address"); } return rc; }
int mca_pml_yalla_del_comm(struct ompi_communicator_t* comm) { mxm_mq_h mq = (void*)comm->c_pml_comm; if (ompi_pml_yalla.mxm_context == NULL) { PML_YALLA_ERROR("Destroying communicator after MXM context is destroyed"); return OMPI_ERROR; } PML_YALLA_VERBOSE(2, "destroying mq ctxid %d of comm %s", comm->c_contextid, comm->c_name); mxm_mq_destroy(mq); return OMPI_SUCCESS; }
static int mca_pml_yalla_recv_request_cancel(ompi_request_t *request, int flag) { mca_pml_yalla_recv_request_t *rreq = (mca_pml_yalla_recv_request_t*)request; mxm_error_t error; error = mxm_req_cancel_recv(&rreq->mxm); if ((error != MXM_OK) && (error != MXM_ERR_NO_PROGRESS)) { PML_YALLA_ERROR("failed to cancel receive request %p: %s", (void *)request, mxm_error_string(error)); return OMPI_ERROR; } PML_YALLA_VERBOSE(9, "canceled receive request %p", (void *)request); return OMPI_SUCCESS; }
int mca_pml_yalla_add_procs(struct ompi_proc_t **procs, size_t nprocs) { size_t i; int ret; void *address; mxm_conn_h conn; size_t addrlen; mxm_error_t error; if (OMPI_SUCCESS != (ret = mca_pml_base_pml_check_selected("yalla", procs, nprocs))) { return ret; } for (i = 0; i < nprocs; ++i) { ret = recv_ep_address(procs[i], &address, &addrlen); if (ret < 0) { return ret; } if (procs[i]->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_PML]) { PML_YALLA_VERBOSE(3, "already connected to proc. %s", OPAL_NAME_PRINT(procs[i]->super.proc_name)); continue; } PML_YALLA_VERBOSE(2, "connecting to proc. %s", OPAL_NAME_PRINT(procs[i]->super.proc_name)); error = mxm_ep_connect(ompi_pml_yalla.mxm_ep, address, &conn); free(address); if (MXM_OK != error) { PML_YALLA_ERROR("Failed to connect"); return OMPI_ERROR; } procs[i]->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_PML] = conn; } return OMPI_SUCCESS; }
static int mca_pml_yalla_send_request_cancel(ompi_request_t *request, int flag) { mca_pml_yalla_send_request_t *sreq = (mca_pml_yalla_send_request_t*)request; mxm_error_t error; if (REQUEST_COMPLETE(request)) { /* * This might be a buffered send request which has completed anyway, so * we cannot cancel it anymore. Just hope for the best. */ PML_YALLA_VERBOSE(7, "not canceling a completed send request %p", (void *)request); return OMPI_SUCCESS; } error = mxm_req_cancel_send(&sreq->mxm); if ((error != MXM_OK) && (error != MXM_ERR_NO_PROGRESS)) { PML_YALLA_ERROR("failed to cancel send request %p: %s", (void *)request, mxm_error_string(error)); return OMPI_ERROR; } PML_YALLA_VERBOSE(9, "canceled send request %p", (void *)request); return OMPI_SUCCESS; }