Skip to content

Commit 2cdcc83

Browse files
authored
Merge branch 'main' into mps
2 parents 63340f7 + 845809b commit 2cdcc83

File tree

9 files changed

+525
-499
lines changed

9 files changed

+525
-499
lines changed

examples/netdes/drivertest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# Hub and spoke SPBase classes
1313
from mpisppy.phbase import PHBase
1414
from mpisppy.opt.ph import PH
15-
from mpisppy.fwph.fwph import FWPH
15+
from mpisppy.opt.fwph import FWPH
1616
# Hub and spoke SPCommunicator classes
1717
from mpisppy.cylinders.fwph_spoke import FrankWolfeOuterBound
1818
from mpisppy.cylinders.lagrangian_bounder import LagrangianOuterBound

examples/uc/uc4wood.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Hub and spoke SPBase classes
1919
from mpisppy.phbase import PHBase
2020
from mpisppy.opt.ph import PH
21-
from mpisppy.fwph.fwph import FWPH
21+
from mpisppy.opt.fwph import FWPH
2222
from mpisppy.utils.xhat_eval import Xhat_Eval
2323
# Hub and spoke SPCommunicator classes
2424
from mpisppy.cylinders.fwph_spoke import FrankWolfeOuterBound

mpisppy/cylinders/hub.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,12 @@ def sync(self):
590590
self.send_ws()
591591
if self.has_nonant_spokes:
592592
self.send_nonants()
593-
if self.has_bounds_only_spokes:
594-
self.send_boundsout()
595593
if self.has_outerbound_spokes:
596594
self.receive_outerbounds()
597595
if self.has_innerbound_spokes:
598596
self.receive_innerbounds()
597+
if self.has_bounds_only_spokes:
598+
self.send_boundsout()
599599
if self.opt.extensions is not None:
600600
self.sync_extension_fields()
601601
self.opt.extobject.sync_with_spokes()
@@ -626,6 +626,8 @@ def sync_Ws(self):
626626
def is_converged(self):
627627
if self.opt.best_bound_obj_val is not None:
628628
self.BestOuterBound = self.OuterBoundUpdate(self.opt.best_bound_obj_val)
629+
if self.opt.best_solution_obj_val is not None:
630+
self.BestInnerBound = self.InnerBoundUpdate(self.opt.best_solution_obj_val)
629631

630632
if not self.has_innerbound_spokes:
631633
if self.opt._PHIter == 1:
@@ -669,6 +671,7 @@ def send_nonants(self):
669671
""" Gather nonants and send them to the appropriate spokes
670672
TODO: Will likely fail with bundling
671673
"""
674+
# TODO: why save here? We get the values directly from the variables
672675
self.opt._save_nonants()
673676
ci = 0 ## index to self.nonant_send_buffer
674677
# my_nonants = self._sends[Field.NONANT]
@@ -815,3 +818,10 @@ def finalize(self):
815818
# to APH.post_loops
816819
Eobj = self.opt.post_loops()
817820
return Eobj
821+
822+
class FWPHHub(PHHub):
823+
824+
_hub_algo_best_bound_provider = True
825+
826+
def main(self):
827+
self.opt.fwph_main(finalize=False)

mpisppy/fwph/__init__.py

Whitespace-only changes.

mpisppy/generic_cylinders.py

+10
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ def _do_decomp(module, cfg, scenario_creator, scenario_creator_kwargs, scenario_
177177
rho_setter = rho_setter,
178178
all_nodenames = all_nodenames,
179179
)
180+
elif cfg.fwph_hub:
181+
# Vanilla FWPH hub
182+
hub_dict = vanilla.fwph_hub(
183+
*beans,
184+
scenario_creator_kwargs=scenario_creator_kwargs,
185+
ph_extensions=None,
186+
ph_converger=ph_converger,
187+
rho_setter = rho_setter,
188+
all_nodenames = all_nodenames,
189+
)
180190
else:
181191
# Vanilla PH hub
182192
hub_dict = vanilla.ph_hub(*beans,

0 commit comments

Comments
 (0)