@@ -1071,21 +1071,25 @@ int ompi_osc_ucx_rput(const void *origin_addr, int origin_count,
10711071 return ret ;
10721072 }
10731073
1074- ret = opal_common_ucx_wpmem_fence (mem );
1075- if (ret != OMPI_SUCCESS ) {
1076- OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_fence failed: %d" , ret );
1077- return OMPI_ERROR ;
1078- }
1079-
10801074 mca_osc_ucx_component .num_incomplete_req_ops ++ ;
1081- /* TODO: investigate whether ucp_worker_flush_nb is a better choice here */
1082- ret = opal_common_ucx_wpmem_fetch_nb (module -> state_mem , UCP_ATOMIC_FETCH_OP_FADD ,
1083- 0 , target , & (module -> req_result ),
1084- sizeof (uint64_t ), remote_addr & (~0x7 ),
1085- req_completion , ucx_req );
1075+ ret = opal_common_ucx_wpmem_flush_ep_nb (mem , target , req_completion , ucx_req );
1076+
10861077 if (ret != OMPI_SUCCESS ) {
1087- OMPI_OSC_UCX_REQUEST_RETURN (ucx_req );
1088- return ret ;
1078+ /* fallback to using an atomic op to acquire a request handle */
1079+ ret = opal_common_ucx_wpmem_fence (mem );
1080+ if (ret != OMPI_SUCCESS ) {
1081+ OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_fence failed: %d" , ret );
1082+ return OMPI_ERROR ;
1083+ }
1084+
1085+ ret = opal_common_ucx_wpmem_fetch_nb (mem , UCP_ATOMIC_FETCH_OP_FADD ,
1086+ 0 , target , & (module -> req_result ),
1087+ sizeof (uint64_t ), remote_addr & (~0x7 ),
1088+ req_completion , ucx_req );
1089+ if (ret != OMPI_SUCCESS ) {
1090+ OMPI_OSC_UCX_REQUEST_RETURN (ucx_req );
1091+ return ret ;
1092+ }
10891093 }
10901094
10911095 * request = & ucx_req -> super ;
@@ -1120,21 +1124,25 @@ int ompi_osc_ucx_rget(void *origin_addr, int origin_count,
11201124 return ret ;
11211125 }
11221126
1123- ret = opal_common_ucx_wpmem_fence (mem );
1124- if (ret != OMPI_SUCCESS ) {
1125- OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_fence failed: %d" , ret );
1126- return OMPI_ERROR ;
1127- }
1128-
11291127 mca_osc_ucx_component .num_incomplete_req_ops ++ ;
1130- /* TODO: investigate whether ucp_worker_flush_nb is a better choice here */
1131- ret = opal_common_ucx_wpmem_fetch_nb (module -> state_mem , UCP_ATOMIC_FETCH_OP_FADD ,
1132- 0 , target , & (module -> req_result ),
1133- sizeof (uint64_t ), remote_addr & (~0x7 ),
1134- req_completion , ucx_req );
1128+ ret = opal_common_ucx_wpmem_flush_ep_nb (mem , target , req_completion , ucx_req );
1129+
11351130 if (ret != OMPI_SUCCESS ) {
1136- OMPI_OSC_UCX_REQUEST_RETURN (ucx_req );
1137- return ret ;
1131+ /* fallback to using an atomic op to acquire a request handle */
1132+ ret = opal_common_ucx_wpmem_fence (mem );
1133+ if (ret != OMPI_SUCCESS ) {
1134+ OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_fence failed: %d" , ret );
1135+ return OMPI_ERROR ;
1136+ }
1137+
1138+ ret = opal_common_ucx_wpmem_fetch_nb (mem , UCP_ATOMIC_FETCH_OP_FADD ,
1139+ 0 , target , & (module -> req_result ),
1140+ sizeof (uint64_t ), remote_addr & (~0x7 ),
1141+ req_completion , ucx_req );
1142+ if (ret != OMPI_SUCCESS ) {
1143+ OMPI_OSC_UCX_REQUEST_RETURN (ucx_req );
1144+ return ret ;
1145+ }
11381146 }
11391147
11401148 * request = & ucx_req -> super ;
0 commit comments