int mca_spml_ucx_fence(shmem_ctx_t ctx) { ucs_status_t err; mca_spml_ucx_ctx_t *ucx_ctx = (mca_spml_ucx_ctx_t *)ctx; err = ucp_worker_fence(ucx_ctx->ucp_worker); if (UCS_OK != err) { SPML_UCX_ERROR("fence failed: %s", ucs_status_string(err)); oshmem_shmem_abort(-1); return OSHMEM_ERROR; } return OSHMEM_SUCCESS; }
int ompi_osc_ucx_sync(struct ompi_win_t *win) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t *)win->w_osc_module; ucs_status_t status; if (module->epoch_type.access != PASSIVE_EPOCH && module->epoch_type.access != PASSIVE_ALL_EPOCH) { return OMPI_ERR_RMA_SYNC; } opal_atomic_mb(); status = ucp_worker_fence(mca_osc_ucx_component.ucp_worker); if (status != UCS_OK) { OSC_UCX_VERBOSE(1, "ucp_worker_fence failed: %d", status); return OMPI_ERROR; } return OMPI_SUCCESS; }
int ompi_osc_ucx_rget(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request) { ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module; ucp_ep_h ep = OSC_UCX_GET_EP(module->comm, target); uint64_t remote_addr = (module->state_info_array[target]).addr + OSC_UCX_STATE_REQ_FLAG_OFFSET; ucp_rkey_h rkey; ompi_osc_ucx_request_t *ucx_req = NULL; ompi_osc_ucx_internal_request_t *internal_req = NULL; ucs_status_t status; int ret = OMPI_SUCCESS; ret = check_sync_state(module, target, true); if (ret != OMPI_SUCCESS) { return ret; } if (module->flavor == MPI_WIN_FLAVOR_DYNAMIC) { status = get_dynamic_win_info(remote_addr, module, ep, target); if (status != UCS_OK) { return OMPI_ERROR; } } rkey = (module->win_info_array[target]).rkey; OMPI_OSC_UCX_REQUEST_ALLOC(win, ucx_req); if (NULL == ucx_req) { return OMPI_ERR_TEMP_OUT_OF_RESOURCE; } ret = ompi_osc_ucx_get(origin_addr, origin_count, origin_dt, target, target_disp, target_count, target_dt, win); if (ret != OMPI_SUCCESS) { return ret; } status = ucp_worker_fence(mca_osc_ucx_component.ucp_worker); if (status != UCS_OK) { opal_output_verbose(1, ompi_osc_base_framework.framework_output, "%s:%d: ucp_worker_fence failed: %d\n", __FILE__, __LINE__, status); return OMPI_ERROR; } internal_req = ucp_atomic_fetch_nb(ep, UCP_ATOMIC_FETCH_OP_FADD, 0, &(module->req_result), sizeof(uint64_t), remote_addr, rkey, req_completion); if (UCS_PTR_IS_PTR(internal_req)) { internal_req->external_req = ucx_req; mca_osc_ucx_component.num_incomplete_req_ops++; } else { ompi_request_complete(&ucx_req->super, true); } *request = &ucx_req->super; return incr_and_check_ops_num(module, target, ep); }