Merge pull request #6934 from devreal/osc-ucx-excl-lock-v4.0.x
UCX osc: properly release exclusive lock to avoid lockup (v4.0.x)
Этот коммит содержится в:
Коммит
2d515f747f
@ -90,21 +90,19 @@ static inline int start_exclusive(ompi_osc_ucx_module_t *module, int target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline int end_exclusive(ompi_osc_ucx_module_t *module, int target) {
|
static inline int end_exclusive(ompi_osc_ucx_module_t *module, int target) {
|
||||||
uint64_t result_value = 0;
|
|
||||||
ucp_ep_h ep = OSC_UCX_GET_EP(module->comm, target);
|
ucp_ep_h ep = OSC_UCX_GET_EP(module->comm, target);
|
||||||
ucp_rkey_h rkey = (module->state_info_array)[target].rkey;
|
ucp_rkey_h rkey = (module->state_info_array)[target].rkey;
|
||||||
uint64_t remote_addr = (module->state_info_array)[target].addr + OSC_UCX_STATE_LOCK_OFFSET;
|
uint64_t remote_addr = (module->state_info_array)[target].addr + OSC_UCX_STATE_LOCK_OFFSET;
|
||||||
int ret;
|
ucs_status_t status;
|
||||||
|
|
||||||
ret = opal_common_ucx_atomic_fetch(ep, UCP_ATOMIC_FETCH_OP_SWAP, TARGET_LOCK_UNLOCKED,
|
status = ucp_atomic_post(ep, UCP_ATOMIC_POST_OP_ADD,
|
||||||
&result_value, sizeof(result_value),
|
-((int64_t)TARGET_LOCK_EXCLUSIVE), sizeof(uint64_t),
|
||||||
remote_addr, rkey, mca_osc_ucx_component.ucp_worker);
|
remote_addr, rkey);
|
||||||
if (OMPI_SUCCESS != ret) {
|
if (UCS_OK != status) {
|
||||||
return ret;
|
OSC_UCX_VERBOSE(1, "ucp_atomic_post(OP_ADD) failed: %d", status);
|
||||||
|
return OMPI_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(result_value >= TARGET_LOCK_EXCLUSIVE);
|
|
||||||
|
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user