@@ -1143,6 +1143,9 @@ int ompi_osc_ucx_free(struct ompi_win_t *win) {
1143
1143
ompi_osc_ucx_module_t * module = (ompi_osc_ucx_module_t * ) win -> w_osc_module ;
1144
1144
int ret ;
1145
1145
uint64_t i ;
1146
+ ucs_status_ptr_t request ;
1147
+ ucp_request_param_t param = {0 };
1148
+ ucp_ep_h ep ;
1146
1149
1147
1150
assert (module -> lock_count == 0 );
1148
1151
assert (opal_list_is_empty (& module -> pending_posts ) == true);
@@ -1162,6 +1165,29 @@ int ompi_osc_ucx_free(struct ompi_win_t *win) {
1162
1165
return ret ;
1163
1166
}
1164
1167
1168
+ if (!opal_common_ucx_thread_enabled &&
1169
+ mca_osc_ucx_component .num_modules == 1 ) {
1170
+ /* flush all the default endpoints for the last window */
1171
+ for (i = 0 ; i < mca_osc_ucx_component .comm_world_size ; i ++ ) {
1172
+ ep = mca_osc_ucx_component .endpoints [i ];
1173
+ if (ep != NULL ) {
1174
+ request = ucp_ep_flush_nbx (ep , & param );
1175
+ ret = opal_common_ucx_wait_request (request ,
1176
+ mca_osc_ucx_component .wpool -> dflt_winfo -> worker ,
1177
+ "ucp_flush_nbx" );
1178
+ if (ret != OMPI_SUCCESS ) {
1179
+ return ret ;
1180
+ }
1181
+ }
1182
+ }
1183
+ }
1184
+
1185
+ ret = module -> comm -> c_coll -> coll_barrier (module -> comm ,
1186
+ module -> comm -> c_coll -> coll_barrier_module );
1187
+ if (ret != OMPI_SUCCESS ) {
1188
+ return ret ;
1189
+ }
1190
+
1165
1191
if (module -> flavor == MPI_WIN_FLAVOR_SHARED ) {
1166
1192
if (module -> segment_base != NULL )
1167
1193
opal_shmem_segment_detach (& module -> seg_ds );
0 commit comments