@@ -74,9 +74,20 @@ int ompi_osc_ucx_fence(int mpi_assert, struct ompi_win_t *win) {
74
74
}
75
75
76
76
if (!(mpi_assert & MPI_MODE_NOPRECEDE )) {
77
- ret = opal_common_ucx_wpmem_flush (module -> mem , OPAL_COMMON_UCX_SCOPE_WORKER , 0 /*ignore*/ );
78
- if (ret != OMPI_SUCCESS ) {
79
- return ret ;
77
+ if (module -> flavor == MPI_WIN_FLAVOR_DYNAMIC ) {
78
+ int i ;
79
+ for (i = 0 ; i < OMPI_OSC_UCX_ATTACH_MAX ; i ++ ) {
80
+ ret = opal_common_ucx_wpmem_flush (module -> local_dynamic_win_info [i ].mem ,
81
+ OPAL_COMMON_UCX_SCOPE_WORKER , 0 /*ignore*/ );
82
+ if (ret != OMPI_SUCCESS ) {
83
+ return ret ;
84
+ }
85
+ }
86
+ } else {
87
+ ret = opal_common_ucx_wpmem_flush (module -> mem , OPAL_COMMON_UCX_SCOPE_WORKER , 0 /*ignore*/ );
88
+ if (ret != OMPI_SUCCESS ) {
89
+ return ret ;
90
+ }
80
91
}
81
92
}
82
93
@@ -181,14 +192,14 @@ int ompi_osc_ucx_complete(struct ompi_win_t *win) {
181
192
for (i = 0 ; i < size ; i ++ ) {
182
193
uint64_t remote_addr = module -> state_addrs [module -> start_grp_ranks [i ]] + OSC_UCX_STATE_COMPLETE_COUNT_OFFSET ; // write to state.complete_count on remote side
183
194
184
- ret = opal_common_ucx_wpmem_post (module -> mem , UCP_ATOMIC_POST_OP_ADD ,
195
+ ret = opal_common_ucx_wpmem_post (module -> state_mem , UCP_ATOMIC_POST_OP_ADD ,
185
196
1 , module -> start_grp_ranks [i ], sizeof (uint64_t ),
186
197
remote_addr );
187
198
if (ret != OMPI_SUCCESS ) {
188
199
OSC_UCX_VERBOSE (1 , "opal_common_ucx_mem_post failed: %d" , ret );
189
200
}
190
201
191
- ret = opal_common_ucx_wpmem_flush (module -> mem , OPAL_COMMON_UCX_SCOPE_EP ,
202
+ ret = opal_common_ucx_wpmem_flush (module -> state_mem , OPAL_COMMON_UCX_SCOPE_EP ,
192
203
module -> start_grp_ranks [i ]);
193
204
if (ret != OMPI_SUCCESS ) {
194
205
return ret ;
@@ -243,10 +254,13 @@ int ompi_osc_ucx_post(struct ompi_group_t *group, int mpi_assert, struct ompi_wi
243
254
uint64_t remote_addr = module -> state_addrs [ranks_in_win_grp [i ]] + OSC_UCX_STATE_POST_INDEX_OFFSET ; // write to state.post_index on remote side
244
255
uint64_t curr_idx = 0 , result = 0 ;
245
256
257
+
258
+
246
259
/* do fop first to get an post index */
247
- ret = opal_common_ucx_wpmem_fetch (module -> mem , UCP_ATOMIC_FETCH_OP_FADD ,
260
+ ret = opal_common_ucx_wpmem_fetch (module -> state_mem , UCP_ATOMIC_FETCH_OP_FADD ,
248
261
1 , ranks_in_win_grp [i ], & result ,
249
262
sizeof (result ), remote_addr );
263
+
250
264
if (ret != OMPI_SUCCESS ) {
251
265
ret = OMPI_ERROR ;
252
266
goto cleanup ;
@@ -258,9 +272,12 @@ int ompi_osc_ucx_post(struct ompi_group_t *group, int mpi_assert, struct ompi_wi
258
272
259
273
/* do cas to send post message */
260
274
do {
261
- ret = opal_common_ucx_wpmem_cmpswp (module -> mem , 0 , result ,
262
- myrank + 1 , & result , sizeof (result ),
275
+
276
+ result = myrank + 1 ;
277
+ ret = opal_common_ucx_wpmem_cmpswp (module -> state_mem , 0 , result ,
278
+ ranks_in_win_grp [i ], & result , sizeof (result ),
263
279
remote_addr );
280
+
264
281
if (ret != OMPI_SUCCESS ) {
265
282
ret = OMPI_ERROR ;
266
283
goto cleanup ;
0 commit comments