Skip to content

Commit 7101bb6

Browse files
committed
add more granular callouts to PH
1 parent e487023 commit 7101bb6

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

mpisppy/cylinders/hub.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,26 @@ def sync(self):
532532
def sync_with_spokes(self):
533533
self.sync()
534534

535+
def sync_bounds(self):
536+
if self.has_outerbound_spokes:
537+
self.receive_outerbounds()
538+
if self.has_innerbound_spokes:
539+
self.receive_innerbounds()
540+
if self.has_bounds_only_spokes:
541+
self.send_boundsout()
542+
543+
def sync_extensions(self):
544+
if self.opt.extensions is not None:
545+
self.opt.extobject.sync_with_spokes()
546+
547+
def sync_nonants(self):
548+
if self.has_nonant_spokes:
549+
self.send_nonants()
550+
551+
def sync_Ws(self):
552+
if self.has_w_spokes:
553+
self.send_ws()
554+
535555
def is_converged(self):
536556
if self.opt.best_bound_obj_val is not None:
537557
self.BestOuterBound = self.OuterBoundUpdate(self.opt.best_bound_obj_val)

mpisppy/phbase.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,8 @@ def _vb(msg):
936936
self.best_bound_obj_val = self.trivial_bound
937937

938938
if self.spcomm is not None:
939-
self.spcomm.sync()
939+
self.spcomm.sync_nonants()
940+
self.spcomm.sync_extensions()
940941

941942
if have_extensions:
942943
self.extobject.post_iter0_after_sync()
@@ -1022,6 +1023,9 @@ def iterk_loop(self):
10221023
self.Update_W(verbose)
10231024
#global_toc('Rank: {} - After Update_W'.format(self.cylinder_rank), True)
10241025

1026+
if self.spcomm is not None:
1027+
self.spcomm.sync_Ws()
1028+
10251029
if smoothed:
10261030
self.Update_z(verbose)
10271031

@@ -1067,7 +1071,9 @@ def iterk_loop(self):
10671071
self.extobject.enditer()
10681072

10691073
if self.spcomm is not None:
1070-
self.spcomm.sync()
1074+
self.spcomm.sync_nonants()
1075+
self.spcomm.sync_bounds()
1076+
self.spcomm.sync_extensions()
10711077
if self.spcomm.is_converged():
10721078
global_toc("Cylinder convergence", self.cylinder_rank == 0)
10731079
break

0 commit comments

Comments
 (0)