Skip to content

Commit 08cb638

Browse files
committed
UCX osc: properly release exclusive lock to avoid lockup
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 71e1fad commit 08cb638

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

ompi/mca/osc/ucx/osc_ucx_passive_target.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,10 @@ static inline int start_exclusive(ompi_osc_ucx_module_t *module, int target) {
7676
}
7777

7878
static inline int end_exclusive(ompi_osc_ucx_module_t *module, int target) {
79-
uint64_t result_value = 0;
8079
uint64_t remote_addr = (module->state_addrs)[target] + OSC_UCX_STATE_LOCK_OFFSET;
81-
int ret = OMPI_SUCCESS;
82-
83-
ret = opal_common_ucx_wpmem_fetch(module->state_mem,
84-
UCP_ATOMIC_FETCH_OP_SWAP, TARGET_LOCK_UNLOCKED,
85-
target, &result_value, sizeof(result_value),
86-
remote_addr);
87-
if (OMPI_SUCCESS != ret) {
88-
return ret;
89-
}
90-
91-
assert(result_value >= TARGET_LOCK_EXCLUSIVE);
92-
93-
return ret;
80+
return opal_common_ucx_wpmem_post(module->state_mem, UCP_ATOMIC_POST_OP_ADD,
81+
-((int64_t)TARGET_LOCK_UNLOCKED), target,
82+
sizeof(uint64_t), remote_addr);
9483
}
9584

9685
int ompi_osc_ucx_lock(int lock_type, int target, int assert, struct ompi_win_t *win) {

0 commit comments

Comments
 (0)