@@ -1115,21 +1115,28 @@ int ompi_osc_ucx_rput(const void *origin_addr, int origin_count,
11151115 return ret ;
11161116 }
11171117
1118- ret = opal_common_ucx_wpmem_fence (mem );
1119- if (ret != OMPI_SUCCESS ) {
1120- OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_fence failed: %d" , ret );
1121- return OMPI_ERROR ;
1122- }
1123-
11241118 mca_osc_ucx_component .num_incomplete_req_ops ++ ;
1125- /* TODO: investigate whether ucp_worker_flush_nb is a better choice here */
1126- ret = opal_common_ucx_wpmem_fetch_nb (module -> state_mem , UCP_ATOMIC_FETCH_OP_FADD ,
1127- 0 , target , & (module -> req_result ),
1128- sizeof (uint64_t ), remote_addr & (~0x7 ),
1129- req_completion , ucx_req );
1119+ ret = opal_common_ucx_wpmem_flush_ep_nb (mem , target , req_completion , ucx_req );
1120+
11301121 if (ret != OMPI_SUCCESS ) {
11311122 OMPI_OSC_UCX_REQUEST_RETURN (ucx_req );
11321123 return ret ;
1124+
1125+ /* fallback to using an atomic op to acquire a request handle */
1126+ ret = opal_common_ucx_wpmem_fence (mem );
1127+ if (ret != OMPI_SUCCESS ) {
1128+ OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_fence failed: %d" , ret );
1129+ return OMPI_ERROR ;
1130+ }
1131+
1132+ ret = opal_common_ucx_wpmem_fetch_nb (mem , UCP_ATOMIC_FETCH_OP_FADD ,
1133+ 0 , target , & (module -> req_result ),
1134+ sizeof (uint64_t ), remote_addr & (~0x7 ),
1135+ req_completion , ucx_req );
1136+ if (ret != OMPI_SUCCESS ) {
1137+ OMPI_OSC_UCX_REQUEST_RETURN (ucx_req );
1138+ return ret ;
1139+ }
11331140 }
11341141
11351142 * request = & ucx_req -> super ;
@@ -1170,21 +1177,28 @@ int ompi_osc_ucx_rget(void *origin_addr, int origin_count,
11701177 return ret ;
11711178 }
11721179
1173- ret = opal_common_ucx_wpmem_fence (mem );
1174- if (ret != OMPI_SUCCESS ) {
1175- OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_fence failed: %d" , ret );
1176- return OMPI_ERROR ;
1177- }
1178-
11791180 mca_osc_ucx_component .num_incomplete_req_ops ++ ;
1180- /* TODO: investigate whether ucp_worker_flush_nb is a better choice here */
1181- ret = opal_common_ucx_wpmem_fetch_nb (module -> state_mem , UCP_ATOMIC_FETCH_OP_FADD ,
1182- 0 , target , & (module -> req_result ),
1183- sizeof (uint64_t ), remote_addr & (~0x7 ),
1184- req_completion , ucx_req );
1181+ ret = opal_common_ucx_wpmem_flush_ep_nb (mem , target , req_completion , ucx_req );
1182+
11851183 if (ret != OMPI_SUCCESS ) {
11861184 OMPI_OSC_UCX_REQUEST_RETURN (ucx_req );
11871185 return ret ;
1186+
1187+ /* fallback to using an atomic op to acquire a request handle */
1188+ ret = opal_common_ucx_wpmem_fence (mem );
1189+ if (ret != OMPI_SUCCESS ) {
1190+ OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_fence failed: %d" , ret );
1191+ return OMPI_ERROR ;
1192+ }
1193+
1194+ ret = opal_common_ucx_wpmem_fetch_nb (mem , UCP_ATOMIC_FETCH_OP_FADD ,
1195+ 0 , target , & (module -> req_result ),
1196+ sizeof (uint64_t ), remote_addr & (~0x7 ),
1197+ req_completion , ucx_req );
1198+ if (ret != OMPI_SUCCESS ) {
1199+ OMPI_OSC_UCX_REQUEST_RETURN (ucx_req );
1200+ return ret ;
1201+ }
11881202 }
11891203
11901204 * request = & ucx_req -> super ;
0 commit comments