Skip to content

Commit 92bf5f7

Browse files
authored
Removing a few barriers and commenting others
1 parent 4fac521 commit 92bf5f7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mpisppy/cylinders/hub.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,14 @@ def hub_to_spoke(self, values, spoke_strata_rank):
346346
f"Attempting to put array of length {len(values)} "
347347
f"into local buffer of length {expected_length}"
348348
)
349+
# this is so the spoke ranks all get the same write_id at approximately the same time
349350
self.cylinder_comm.Barrier()
350351
self.local_write_ids[spoke_strata_rank - 1] += 1
351352
values[-1] = self.local_write_ids[spoke_strata_rank - 1]
352353
window = self.windows[spoke_strata_rank - 1]
353354
window.Lock(self.strata_rank)
354355
window.Put((values, len(values), MPI.DOUBLE), self.strata_rank)
355356
window.Unlock(self.strata_rank)
356-
self.cylinder_comm.Barrier()
357357

358358
def hub_from_spoke(self, values, spoke_num):
359359
""" 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):
368368
f"Hub trying to get buffer of length {expected_length} "
369369
f"from spoke, but provided buffer has length {len(values)}."
370370
)
371+
# so the window in each rank gets read at approximately the same time,
372+
# and so has the same write_id
371373
self.cylinder_comm.Barrier()
372374
window = self.windows[spoke_num - 1]
373375
window.Lock(spoke_num)

mpisppy/cylinders/spoke.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def spoke_to_hub(self, values):
8080
window.Lock(self.strata_rank)
8181
window.Put((values, len(values), MPI.DOUBLE), self.strata_rank)
8282
window.Unlock(self.strata_rank)
83-
self.cylinder_comm.Barrier()
8483

8584
def spoke_from_hub(self, values):
8685
"""

0 commit comments

Comments
 (0)