@@ -346,14 +346,14 @@ def hub_to_spoke(self, values, spoke_strata_rank):
346
346
f"Attempting to put array of length { len (values )} "
347
347
f"into local buffer of length { expected_length } "
348
348
)
349
+ # this is so the spoke ranks all get the same write_id at approximately the same time
349
350
self .cylinder_comm .Barrier ()
350
351
self .local_write_ids [spoke_strata_rank - 1 ] += 1
351
352
values [- 1 ] = self .local_write_ids [spoke_strata_rank - 1 ]
352
353
window = self .windows [spoke_strata_rank - 1 ]
353
354
window .Lock (self .strata_rank )
354
355
window .Put ((values , len (values ), MPI .DOUBLE ), self .strata_rank )
355
356
window .Unlock (self .strata_rank )
356
- self .cylinder_comm .Barrier ()
357
357
358
358
def hub_from_spoke (self , values , spoke_num ):
359
359
""" spoke_num is the rank in the strata_comm, so it is 1-based not 0-based
@@ -368,6 +368,8 @@ def hub_from_spoke(self, values, spoke_num):
368
368
f"Hub trying to get buffer of length { expected_length } "
369
369
f"from spoke, but provided buffer has length { len (values )} ."
370
370
)
371
+ # so the window in each rank gets read at approximately the same time,
372
+ # and so has the same write_id
371
373
self .cylinder_comm .Barrier ()
372
374
window = self .windows [spoke_num - 1 ]
373
375
window .Lock (spoke_num )
0 commit comments