Skip to content

Commit 45b4ed5

Browse files
Allowing the spokes xhatxbar and ph_ob to use variable probability and deleting it in the other spokes
1 parent d82f765 commit 45b4ed5

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Diff for: examples/distr/distr_admm_cylinders.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Copyright 2020 by B. Knueven, D. Mildebrath, C. Muir, J-P Watson, and D.L. Woodruff
2-
# This software is distributed under the 3-clause BSD License.
31
# general example driver for distr with cylinders
42
import mpisppy.utils.admm_ph as admm_ph
53
import distr
@@ -99,14 +97,14 @@ def main():
9997

10098
# FWPH spoke
10199
if cfg.fwph:
100+
print("May not give the expected result due to variable probability")
102101
fw_spoke = vanilla.fwph_spoke(*beans, scenario_creator_kwargs=scenario_creator_kwargs)
103102

104103
# Standard Lagrangian bound spoke
105104
if cfg.lagrangian:
106105
lagrangian_spoke = vanilla.lagrangian_spoke(*beans,
107106
scenario_creator_kwargs=scenario_creator_kwargs,
108-
rho_setter = None,
109-
variable_probability=variable_probability)
107+
rho_setter = None)
110108

111109

112110
# ph outer bounder spoke
@@ -142,7 +140,7 @@ def main():
142140
wheel.write_tree_solution('distr_full_solution')
143141

144142
if global_rank == 0:
145-
best_objective = wheel.spcomm.BestInnerBound * len(all_scenario_names)
143+
best_objective = wheel.spcomm.BestInnerBound
146144
print(f"{best_objective=}")
147145

148146

Diff for: mpisppy/utils/cfg_vanilla.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ def xhatxbar_spoke(
512512
all_scenario_names,
513513
scenario_creator_kwargs=None,
514514
variable_probability=None,
515-
ph_extensions=None
515+
ph_extensions=None,
516+
all_nodenames=None,
516517
):
517518
xhatxbar_dict = _Xhat_Eval_spoke_foundation(
518519
XhatXbarInnerBound,
@@ -522,6 +523,7 @@ def xhatxbar_spoke(
522523
all_scenario_names,
523524
scenario_creator_kwargs=scenario_creator_kwargs,
524525
ph_extensions=ph_extensions,
526+
all_nodenames=all_nodenames,
525527
)
526528

527529
xhatxbar_dict["opt_kwargs"]["options"]['bundles_per_rank'] = 0 # no bundles for xhat
@@ -702,7 +704,8 @@ def ph_ob_spoke(
702704
all_scenario_names,
703705
scenario_creator_kwargs=None,
704706
rho_setter=None,
705-
all_nodenames = None,
707+
all_nodenames=None,
708+
variable_probability=None,
706709
):
707710
shoptions = shared_options(cfg)
708711
ph_ob_spoke = {
@@ -715,7 +718,8 @@ def ph_ob_spoke(
715718
"scenario_creator_kwargs": scenario_creator_kwargs,
716719
'scenario_denouement': scenario_denouement,
717720
"rho_setter": rho_setter,
718-
"all_nodenames": all_nodenames
721+
"all_nodenames": all_nodenames,
722+
"variable_probability": variable_probability,
719723
}
720724
}
721725
if cfg.ph_ob_rho_rescale_factors_json is not None:

0 commit comments

Comments
 (0)