Skip to content

Commit ce1791b

Browse files
authored
Merge pull request #10320 from MamziB/mamzi/osc-rget-rput
osc/ucx: use remote state mem to do fetch-and-add to realize the completion of put/get
2 parents ba14755 + 68991b6 commit ce1791b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ompi/mca/osc/ucx/osc_ucx_comm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ int ompi_osc_ucx_rput(const void *origin_addr, int origin_count,
10661066
struct ompi_win_t *win, struct ompi_request_t **request) {
10671067
ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module;
10681068
opal_common_ucx_wpmem_t *mem = module->mem;
1069-
uint64_t remote_addr = (module->addrs[target]) + target_disp * OSC_UCX_GET_DISP(module, target);
1069+
uint64_t remote_addr = (module->state_addrs[target]) + OSC_UCX_STATE_REQ_FLAG_OFFSET;
10701070
ompi_osc_ucx_request_t *ucx_req = NULL;
10711071
int ret = OMPI_SUCCESS, win_idx = -1;
10721072

@@ -1100,7 +1100,7 @@ int ompi_osc_ucx_rput(const void *origin_addr, int origin_count,
11001100

11011101
mca_osc_ucx_component.num_incomplete_req_ops++;
11021102
/* TODO: investigate whether ucp_worker_flush_nb is a better choice here */
1103-
ret = opal_common_ucx_wpmem_fetch_nb(mem, UCP_ATOMIC_FETCH_OP_FADD,
1103+
ret = opal_common_ucx_wpmem_fetch_nb(module->state_mem, UCP_ATOMIC_FETCH_OP_FADD,
11041104
0, target, &(module->req_result),
11051105
sizeof(uint64_t), remote_addr & (~0x7),
11061106
req_completion, ucx_req);
@@ -1121,7 +1121,7 @@ int ompi_osc_ucx_rget(void *origin_addr, int origin_count,
11211121
struct ompi_request_t **request) {
11221122
ompi_osc_ucx_module_t *module = (ompi_osc_ucx_module_t*) win->w_osc_module;
11231123
opal_common_ucx_wpmem_t *mem = module->mem;
1124-
uint64_t remote_addr = (module->addrs[target]) + target_disp * OSC_UCX_GET_DISP(module, target);
1124+
uint64_t remote_addr = (module->state_addrs[target]) + OSC_UCX_STATE_REQ_FLAG_OFFSET;
11251125
ompi_osc_ucx_request_t *ucx_req = NULL;
11261126
int ret = OMPI_SUCCESS, win_idx = -1;
11271127

@@ -1155,7 +1155,7 @@ int ompi_osc_ucx_rget(void *origin_addr, int origin_count,
11551155

11561156
mca_osc_ucx_component.num_incomplete_req_ops++;
11571157
/* TODO: investigate whether ucp_worker_flush_nb is a better choice here */
1158-
ret = opal_common_ucx_wpmem_fetch_nb(mem, UCP_ATOMIC_FETCH_OP_FADD,
1158+
ret = opal_common_ucx_wpmem_fetch_nb(module->state_mem, UCP_ATOMIC_FETCH_OP_FADD,
11591159
0, target, &(module->req_result),
11601160
sizeof(uint64_t), remote_addr & (~0x7),
11611161
req_completion, ucx_req);

0 commit comments

Comments
 (0)