Skip to content

Commit eec8197

Browse files
Mamzi Bayatpour  mbayatpour@nvidia.com ()janjust
andcommitted
OSC UCX: Fix the flush issue in dynamic win accumulate
Signed-off-by: Mamzi Bayatpour <mbayatpour@nvidia.com> Co-authored-by: Tomislav Janjusic <tomislavj@nvidia.com>
1 parent c47d78d commit eec8197

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

ompi/mca/osc/ucx/osc_ucx_comm.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,10 @@ int accumulate_req(const void *origin_addr, int origin_count,
631631

632632
ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module;
633633
int ret = OMPI_SUCCESS;
634+
int win_idx = -1;
635+
uint64_t remote_addr = (module->addrs[target]) + target_disp *
636+
OSC_UCX_GET_DISP(module, target);
637+
opal_common_ucx_wpmem_t *mem = module->mem;
634638
void *free_ptr = NULL;
635639
bool lock_acquired = false;
636640

@@ -650,6 +654,14 @@ int accumulate_req(const void *origin_addr, int origin_count,
650654
target_disp, NULL, ucx_req);
651655
}
652656

657+
if (module->flavor == MPI_WIN_FLAVOR_DYNAMIC) {
658+
ret = get_dynamic_win_info(remote_addr, module, target, &win_idx);
659+
if (ret != OMPI_SUCCESS) {
660+
return ret;
661+
}
662+
mem = module->local_dynamic_win_info[win_idx].mem;
663+
}
664+
653665
ret = start_atomicity(module, target, &lock_acquired);
654666
if (ret != OMPI_SUCCESS) {
655667
return ret;
@@ -691,7 +703,7 @@ int accumulate_req(const void *origin_addr, int origin_count,
691703
return ret;
692704
}
693705

694-
ret = opal_common_ucx_wpmem_flush(module->mem, OPAL_COMMON_UCX_SCOPE_EP, target);
706+
ret = opal_common_ucx_wpmem_flush(mem, OPAL_COMMON_UCX_SCOPE_EP, target);
695707
if (ret != OMPI_SUCCESS) {
696708
free(temp_addr);
697709
return ret;
@@ -936,6 +948,10 @@ int get_accumulate_req(const void *origin_addr, int origin_count,
936948
ompi_osc_ucx_request_t *ucx_req) {
937949
ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module;
938950
int ret = OMPI_SUCCESS;
951+
int win_idx = -1;
952+
uint64_t remote_addr = (module->addrs[target]) + target_disp *
953+
OSC_UCX_GET_DISP(module, target);
954+
opal_common_ucx_wpmem_t *mem = module->mem;
939955
void *free_addr = NULL;
940956
bool lock_acquired = false;
941957

@@ -951,6 +967,14 @@ int get_accumulate_req(const void *origin_addr, int origin_count,
951967
target_disp, result_addr, ucx_req);
952968
}
953969

970+
if (module->flavor == MPI_WIN_FLAVOR_DYNAMIC) {
971+
ret = get_dynamic_win_info(remote_addr, module, target, &win_idx);
972+
if (ret != OMPI_SUCCESS) {
973+
return ret;
974+
}
975+
mem = module->local_dynamic_win_info[win_idx].mem;
976+
}
977+
954978
ret = start_atomicity(module, target, &lock_acquired);
955979
if (ret != OMPI_SUCCESS) {
956980
return ret;
@@ -962,7 +986,7 @@ int get_accumulate_req(const void *origin_addr, int origin_count,
962986
return ret;
963987
}
964988

965-
ret = opal_common_ucx_wpmem_flush(module->mem, OPAL_COMMON_UCX_SCOPE_EP, target);
989+
ret = opal_common_ucx_wpmem_flush(mem, OPAL_COMMON_UCX_SCOPE_EP, target);
966990
if (ret != OMPI_SUCCESS) {
967991
return ret;
968992
}
@@ -1004,7 +1028,7 @@ int get_accumulate_req(const void *origin_addr, int origin_count,
10041028
return ret;
10051029
}
10061030

1007-
ret = opal_common_ucx_wpmem_flush(module->mem, OPAL_COMMON_UCX_SCOPE_EP, target);
1031+
ret = opal_common_ucx_wpmem_flush(mem, OPAL_COMMON_UCX_SCOPE_EP, target);
10081032
if (ret != OMPI_SUCCESS) {
10091033
return ret;
10101034
}

0 commit comments

Comments
 (0)