@@ -290,8 +290,7 @@ static inline int get_dynamic_win_info(uint64_t remote_addr, ompi_osc_ucx_module
290290 goto cleanup ;
291291 }
292292
293- ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP ,
294- & mca_osc_ucx_component .num_incomplete_req_ops , target );
293+ ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP , target );
295294 if (ret != OPAL_SUCCESS ) {
296295 ret = OMPI_ERROR ;
297296 goto cleanup ;
@@ -669,8 +668,7 @@ int accumulate_req(const void *origin_addr, int origin_count,
669668 return ret ;
670669 }
671670
672- ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP ,
673- & mca_osc_ucx_component .num_incomplete_req_ops , target );
671+ ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP , target );
674672 if (ret != OMPI_SUCCESS ) {
675673 free (temp_addr );
676674 return ret ;
@@ -730,8 +728,7 @@ int accumulate_req(const void *origin_addr, int origin_count,
730728
731729 }
732730
733- ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP ,
734- & mca_osc_ucx_component .num_incomplete_req_ops , target );
731+ ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP , target );
735732 if (ret != OPAL_SUCCESS ) {
736733 return ret ;
737734 }
@@ -844,8 +841,7 @@ int ompi_osc_ucx_compare_and_swap(const void *origin_addr, const void *compare_a
844841 return OMPI_ERROR ;
845842 }
846843
847- ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP ,
848- & mca_osc_ucx_component .num_incomplete_req_ops , target );
844+ ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP , target );
849845 if (ret != OPAL_SUCCESS ) {
850846 return ret ;
851847 }
@@ -968,8 +964,7 @@ int get_accumulate_req(const void *origin_addr, int origin_count,
968964
969965 if (op != & ompi_mpi_op_no_op .op ) {
970966 if (op == & ompi_mpi_op_replace .op ) {
971- ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP ,
972- & mca_osc_ucx_component .num_incomplete_req_ops , target );
967+ ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP , target );
973968 if (ret != OMPI_SUCCESS ) {
974969 return ret ;
975970 }
@@ -1009,8 +1004,7 @@ int get_accumulate_req(const void *origin_addr, int origin_count,
10091004 return ret ;
10101005 }
10111006
1012- ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP ,
1013- & mca_osc_ucx_component .num_incomplete_req_ops , target );
1007+ ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP , target );
10141008 if (ret != OMPI_SUCCESS ) {
10151009 return ret ;
10161010 }
@@ -1066,8 +1060,7 @@ int get_accumulate_req(const void *origin_addr, int origin_count,
10661060 }
10671061 }
10681062
1069- ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP ,
1070- & mca_osc_ucx_component .num_incomplete_req_ops , target );
1063+ ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_EP , target );
10711064 if (ret != OPAL_SUCCESS ) {
10721065 return ret ;
10731066 }
@@ -1134,8 +1127,9 @@ int ompi_osc_ucx_rput(const void *origin_addr, int origin_count,
11341127 }
11351128
11361129 OMPI_OSC_UCX_REQUEST_ALLOC (win , ucx_req );
1130+ ucx_req -> module = module ;
11371131
1138- OSC_UCX_INCREMENT_OUTSTANDING_NB_OPS ();
1132+ OSC_UCX_INCREMENT_OUTSTANDING_NB_OPS (module );
11391133 ret = opal_common_ucx_wpmem_flush_ep_nb (mem , target , req_completion , ucx_req , ep );
11401134
11411135 if (ret != OMPI_SUCCESS ) {
@@ -1189,8 +1183,9 @@ int ompi_osc_ucx_rget(void *origin_addr, int origin_count,
11891183 }
11901184
11911185 OMPI_OSC_UCX_REQUEST_ALLOC (win , ucx_req );
1186+ ucx_req -> module = module ;
11921187
1193- OSC_UCX_INCREMENT_OUTSTANDING_NB_OPS ();
1188+ OSC_UCX_INCREMENT_OUTSTANDING_NB_OPS (module );
11941189 ret = opal_common_ucx_wpmem_flush_ep_nb (mem , target , req_completion , ucx_req , ep );
11951190
11961191 if (ret != OMPI_SUCCESS ) {
@@ -1232,6 +1227,7 @@ int ompi_osc_ucx_raccumulate(const void *origin_addr, int origin_count,
12321227 }
12331228
12341229 OMPI_OSC_UCX_REQUEST_ALLOC (win , ucx_req );
1230+ ucx_req -> module = module ;
12351231 assert (NULL != ucx_req );
12361232
12371233 ret = accumulate_req (origin_addr , origin_count , origin_dt , target , target_disp ,
@@ -1264,6 +1260,7 @@ int ompi_osc_ucx_rget_accumulate(const void *origin_addr, int origin_count,
12641260 }
12651261
12661262 OMPI_OSC_UCX_REQUEST_ALLOC (win , ucx_req );
1263+ ucx_req -> module = module ;
12671264 assert (NULL != ucx_req );
12681265
12691266 ret = get_accumulate_req (origin_addr , origin_count , origin_datatype ,
@@ -1302,7 +1299,7 @@ static inline int ompi_osc_ucx_acc_rputget(void *stage_addr, int stage_count,
13021299 ucx_req -> acc .op = op ;
13031300 ucx_req -> acc .acc_type = acc_type ;
13041301 ucx_req -> acc .phase = phase ;
1305- ucx_req -> acc . module = module ;
1302+ ucx_req -> module = module ;
13061303 ucx_req -> acc .target = target ;
13071304 ucx_req -> acc .lock_acquired = lock_acquired ;
13081305 ucx_req -> acc .win = win ;
@@ -1349,7 +1346,7 @@ static inline int ompi_osc_ucx_acc_rputget(void *stage_addr, int stage_count,
13491346
13501347 module -> skip_sync_check = sync_check ;
13511348 if (acc_type != NONE ) {
1352- OSC_UCX_INCREMENT_OUTSTANDING_NB_OPS ();
1349+ OSC_UCX_INCREMENT_OUTSTANDING_NB_OPS (module );
13531350 ret = opal_common_ucx_wpmem_flush_ep_nb (mem , target , req_completion , ucx_req , ep );
13541351
13551352 if (ret != OMPI_SUCCESS ) {
@@ -1414,9 +1411,8 @@ static int ompi_osc_ucx_get_accumulate_nonblocking(const void *origin_addr, int
14141411 return ret ;
14151412 }
14161413
1417- if (mca_osc_ucx_component .num_incomplete_req_ops > ompi_osc_ucx_outstanding_ops_flush_threshold ) {
1418- ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_WORKER ,
1419- & mca_osc_ucx_component .num_incomplete_req_ops , 0 );
1414+ if (module -> ctx -> num_incomplete_req_ops > ompi_osc_ucx_outstanding_ops_flush_threshold ) {
1415+ ret = opal_common_ucx_ctx_flush (module -> ctx , OPAL_COMMON_UCX_SCOPE_WORKER , 0 );
14201416 if (ret != OPAL_SUCCESS ) {
14211417 ret = OMPI_ERROR ;
14221418 return ret ;
@@ -1484,7 +1480,7 @@ static int ompi_osc_ucx_get_accumulate_nonblocking(const void *origin_addr, int
14841480void req_completion (void * request ) {
14851481 ompi_osc_ucx_request_t * req = (ompi_osc_ucx_request_t * )request ;
14861482 int ret = OMPI_SUCCESS ;
1487-
1483+ ompi_osc_ucx_module_t * module = req -> module ;
14881484 if (req -> acc .acc_type != NONE ) {
14891485 assert (req -> acc .phase != ACC_INIT );
14901486 void * free_addr = NULL ;
@@ -1505,8 +1501,8 @@ void req_completion(void *request) {
15051501
15061502 if (req -> acc .phase != ACC_FINALIZE ) {
15071503 /* Avoid calling flush while we are already in progress */
1508- req -> acc . module -> mem -> skip_periodic_flush = true;
1509- req -> acc . module -> state_mem -> skip_periodic_flush = true;
1504+ module -> mem -> skip_periodic_flush = true;
1505+ module -> state_mem -> skip_periodic_flush = true;
15101506 }
15111507
15121508 switch (req -> acc .phase ) {
@@ -1620,7 +1616,7 @@ void req_completion(void *request) {
16201616 if (req -> acc .acc_type == GET_ACCUMULATE ) {
16211617 /* Do fence to make sure target results are received before
16221618 * writing into target */
1623- ret = opal_common_ucx_wpmem_fence (req -> acc . module -> mem );
1619+ ret = opal_common_ucx_wpmem_fence (module -> mem );
16241620 if (ret != OMPI_SUCCESS ) {
16251621 OSC_UCX_ERROR ("opal_common_ucx_mem_fence failed: %d" , ret );
16261622 abort ();
@@ -1650,17 +1646,17 @@ void req_completion(void *request) {
16501646 if (release_lock ) {
16511647 /* Ordering between previous put/get operations and unlock will be realized
16521648 * through the ucp fence inside the finalize function */
1653- ompi_osc_ucx_nonblocking_ops_finalize (req -> acc . module , target ,
1649+ ompi_osc_ucx_nonblocking_ops_finalize (module , target ,
16541650 req -> acc .lock_acquired , win , free_addr );
16551651 }
16561652
16571653 if (req -> acc .phase != ACC_FINALIZE ) {
1658- req -> acc . module -> mem -> skip_periodic_flush = false;
1659- req -> acc . module -> state_mem -> skip_periodic_flush = false;
1654+ module -> mem -> skip_periodic_flush = false;
1655+ module -> state_mem -> skip_periodic_flush = false;
16601656 }
16611657 }
16621658
1663- OSC_UCX_DECREMENT_OUTSTANDING_NB_OPS ();
1659+ OSC_UCX_DECREMENT_OUTSTANDING_NB_OPS (module );
16641660 ompi_request_complete (& (req -> super ), true);
1665- assert (mca_osc_ucx_component . num_incomplete_req_ops >= 0 );
1661+ assert (module -> ctx -> num_incomplete_req_ops >= 0 );
16661662}
0 commit comments