Skip to content

Commit 9c2418e

Browse files
authored
Merge pull request #11115 from s417-lama/fix_dynamic_window_v5
v5.0.x: Fix bugs with dynamic windows
2 parents 55503bb + 1a25196 commit 9c2418e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

ompi/mca/osc/ucx/osc_ucx.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ typedef struct ompi_osc_ucx_epoch_type {
8282
#define OSC_UCX_STATE_COMPLETE_COUNT_OFFSET (sizeof(uint64_t) * 3)
8383
#define OSC_UCX_STATE_POST_INDEX_OFFSET (sizeof(uint64_t) * 4)
8484
#define OSC_UCX_STATE_POST_STATE_OFFSET (sizeof(uint64_t) * 5)
85-
#define OSC_UCX_STATE_DYNAMIC_LOCK_OFFSET (sizeof(uint64_t) * 6)
85+
#define OSC_UCX_STATE_DYNAMIC_LOCK_OFFSET (sizeof(uint64_t) * (5 + OMPI_OSC_UCX_POST_PEER_MAX))
8686
#define OSC_UCX_STATE_DYNAMIC_WIN_CNT_OFFSET (sizeof(uint64_t) * (6 + OMPI_OSC_UCX_POST_PEER_MAX))
8787

8888
typedef struct ompi_osc_dynamic_win_info {
@@ -105,6 +105,7 @@ typedef struct ompi_osc_ucx_state {
105105
volatile uint64_t complete_count; /* # msgs received from complete processes */
106106
volatile uint64_t post_index;
107107
volatile uint64_t post_state[OMPI_OSC_UCX_POST_PEER_MAX];
108+
volatile uint64_t dynamic_lock;
108109
volatile uint64_t dynamic_win_count;
109110
volatile ompi_osc_dynamic_win_info_t dynamic_wins[OMPI_OSC_UCX_ATTACH_MAX];
110111
} ompi_osc_ucx_state_t;

ompi/mca/osc/ucx/osc_ucx_comm.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ static inline int get_dynamic_win_info(uint64_t remote_addr,
358358
free(temp_buf);
359359

360360
/* unlock the dynamic lock */
361-
return ompi_osc_ucx_dynamic_unlock(module, target);
361+
ompi_osc_ucx_dynamic_unlock(module, target);
362+
363+
return ret;
362364
}
363365

364366
static inline
@@ -841,7 +843,6 @@ static inline int ompi_osc_ucx_acc_rputget(void *stage_addr, int stage_count,
841843
ompi_osc_ucx_accumulate_request_t *ucx_req = NULL;
842844
bool sync_check;
843845
int ret = OMPI_SUCCESS;
844-
CHECK_DYNAMIC_WIN(remote_addr, module, target, ret);
845846

846847
if (acc_type != NONE) {
847848
OMPI_OSC_UCX_ACCUMULATE_REQUEST_ALLOC(win, ucx_req);
@@ -1392,8 +1393,6 @@ int ompi_osc_ucx_rput(const void *origin_addr, int origin_count,
13921393
return ret;
13931394
}
13941395

1395-
CHECK_DYNAMIC_WIN(remote_addr, module, target, ret);
1396-
13971396
ret = ompi_osc_ucx_put(origin_addr, origin_count, origin_dt, target, target_disp,
13981397
target_count, target_dt, win);
13991398
if (ret != OMPI_SUCCESS) {
@@ -1448,8 +1447,6 @@ int ompi_osc_ucx_rget(void *origin_addr, int origin_count,
14481447
return ret;
14491448
}
14501449

1451-
CHECK_DYNAMIC_WIN(remote_addr, module, target, ret);
1452-
14531450
ret = ompi_osc_ucx_get(origin_addr, origin_count, origin_dt, target, target_disp,
14541451
target_count, target_dt, win);
14551452
if (ret != OMPI_SUCCESS) {

ompi/mca/osc/ucx/osc_ucx_component.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ static int component_select(struct ompi_win_t *win, void **base, size_t size, in
853853
module->state.complete_count = 0;
854854
module->state.req_flag = 0;
855855
module->state.acc_lock = TARGET_LOCK_UNLOCKED;
856+
module->state.dynamic_lock = TARGET_LOCK_UNLOCKED;
856857
module->state.dynamic_win_count = 0;
857858
for (i = 0; i < OMPI_OSC_UCX_ATTACH_MAX; i++) {
858859
module->local_dynamic_win_info[i].refcnt = 0;

0 commit comments

Comments
 (0)