From 6448d57afbd34fcd00748b06e4dadc0244654468 Mon Sep 17 00:00:00 2001 From: Shumpei Shiina Date: Mon, 21 Nov 2022 16:23:32 +0900 Subject: [PATCH 1/3] Correctly return error codes in get_dynamic_win_info() Signed-off-by: Shumpei Shiina (cherry picked from commit d57a39ff1b154058779acef2ba25c0112ed9bc7b) --- ompi/mca/osc/ucx/osc_ucx_comm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ompi/mca/osc/ucx/osc_ucx_comm.c b/ompi/mca/osc/ucx/osc_ucx_comm.c index 134b6d885c5..c827766a7a3 100644 --- a/ompi/mca/osc/ucx/osc_ucx_comm.c +++ b/ompi/mca/osc/ucx/osc_ucx_comm.c @@ -358,7 +358,9 @@ static inline int get_dynamic_win_info(uint64_t remote_addr, free(temp_buf); /* unlock the dynamic lock */ - return ompi_osc_ucx_dynamic_unlock(module, target); + ompi_osc_ucx_dynamic_unlock(module, target); + + return ret; } static inline From a9ff6bc1df47d84340e9bd0513dbf400585557c5 Mon Sep 17 00:00:00 2001 From: Shumpei Shiina Date: Mon, 21 Nov 2022 16:33:50 +0900 Subject: [PATCH 2/3] Add missing dynamic_lock member in ompi_osc_ucx_state struct Signed-off-by: Shumpei Shiina (cherry picked from commit 60e44f32e13bb076e30ff111e2f74eeab47204b6) --- ompi/mca/osc/ucx/osc_ucx.h | 3 ++- ompi/mca/osc/ucx/osc_ucx_component.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ompi/mca/osc/ucx/osc_ucx.h b/ompi/mca/osc/ucx/osc_ucx.h index a54cff73722..d621d7e62fb 100644 --- a/ompi/mca/osc/ucx/osc_ucx.h +++ b/ompi/mca/osc/ucx/osc_ucx.h @@ -82,7 +82,7 @@ typedef struct ompi_osc_ucx_epoch_type { #define OSC_UCX_STATE_COMPLETE_COUNT_OFFSET (sizeof(uint64_t) * 3) #define OSC_UCX_STATE_POST_INDEX_OFFSET (sizeof(uint64_t) * 4) #define OSC_UCX_STATE_POST_STATE_OFFSET (sizeof(uint64_t) * 5) -#define OSC_UCX_STATE_DYNAMIC_LOCK_OFFSET (sizeof(uint64_t) * 6) +#define OSC_UCX_STATE_DYNAMIC_LOCK_OFFSET (sizeof(uint64_t) * (5 + OMPI_OSC_UCX_POST_PEER_MAX)) #define OSC_UCX_STATE_DYNAMIC_WIN_CNT_OFFSET (sizeof(uint64_t) * (6 + OMPI_OSC_UCX_POST_PEER_MAX)) typedef struct ompi_osc_dynamic_win_info { @@ -105,6 +105,7 @@ typedef struct ompi_osc_ucx_state { volatile uint64_t complete_count; /* # msgs received from complete processes */ volatile uint64_t post_index; volatile uint64_t post_state[OMPI_OSC_UCX_POST_PEER_MAX]; + volatile uint64_t dynamic_lock; volatile uint64_t dynamic_win_count; volatile ompi_osc_dynamic_win_info_t dynamic_wins[OMPI_OSC_UCX_ATTACH_MAX]; } ompi_osc_ucx_state_t; diff --git a/ompi/mca/osc/ucx/osc_ucx_component.c b/ompi/mca/osc/ucx/osc_ucx_component.c index a6a901d3a24..6518a0797ac 100644 --- a/ompi/mca/osc/ucx/osc_ucx_component.c +++ b/ompi/mca/osc/ucx/osc_ucx_component.c @@ -838,6 +838,7 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in module->state.complete_count = 0; module->state.req_flag = 0; module->state.acc_lock = TARGET_LOCK_UNLOCKED; + module->state.dynamic_lock = TARGET_LOCK_UNLOCKED; module->state.dynamic_win_count = 0; for (i = 0; i < OMPI_OSC_UCX_ATTACH_MAX; i++) { module->local_dynamic_win_info[i].refcnt = 0; From 1a251966de5a86085c463964eac6831ae5a9d126 Mon Sep 17 00:00:00 2001 From: Shumpei Shiina Date: Mon, 21 Nov 2022 16:44:54 +0900 Subject: [PATCH 3/3] Remove unnecessary (and incorrect) dynamic window checking for rget/rput Signed-off-by: Shumpei Shiina (cherry picked from commit cd40003815db4b961f4eee27fc87222fcdb387b4) --- ompi/mca/osc/ucx/osc_ucx_comm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ompi/mca/osc/ucx/osc_ucx_comm.c b/ompi/mca/osc/ucx/osc_ucx_comm.c index c827766a7a3..7c8372a841e 100644 --- a/ompi/mca/osc/ucx/osc_ucx_comm.c +++ b/ompi/mca/osc/ucx/osc_ucx_comm.c @@ -843,7 +843,6 @@ static inline int ompi_osc_ucx_acc_rputget(void *stage_addr, int stage_count, ompi_osc_ucx_accumulate_request_t *ucx_req = NULL; bool sync_check; int ret = OMPI_SUCCESS; - CHECK_DYNAMIC_WIN(remote_addr, module, target, ret); if (acc_type != NONE) { OMPI_OSC_UCX_ACCUMULATE_REQUEST_ALLOC(win, ucx_req); @@ -1394,8 +1393,6 @@ int ompi_osc_ucx_rput(const void *origin_addr, int origin_count, return ret; } - CHECK_DYNAMIC_WIN(remote_addr, module, target, ret); - ret = ompi_osc_ucx_put(origin_addr, origin_count, origin_dt, target, target_disp, target_count, target_dt, win); if (ret != OMPI_SUCCESS) { @@ -1450,8 +1447,6 @@ int ompi_osc_ucx_rget(void *origin_addr, int origin_count, return ret; } - CHECK_DYNAMIC_WIN(remote_addr, module, target, ret); - ret = ompi_osc_ucx_get(origin_addr, origin_count, origin_dt, target, target_disp, target_count, target_dt, win); if (ret != OMPI_SUCCESS) {