Skip to content

Commit 394540d

Browse files
author
Bernard Knueven
committed
option driving cylinder columns
1 parent 8e187e8 commit 394540d

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

mpisppy/opt/fwph.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def _sync_after_mip_solve(self):
373373
# add columns from cylinder(s)
374374
self._swap_nonant_vars_back()
375375
# spoke or hub (FWPH_Cylinder)
376-
if hasattr(self.spcomm, "add_cylinder_columns"):
376+
if self.FW_options.get("add_cylinder_columns", False) and hasattr(self.spcomm, "add_cylinder_columns"):
377377
self.spcomm.add_cylinder_columns()
378378
# hub
379379
if hasattr(self.spcomm, "sync_bounds"):
@@ -450,7 +450,7 @@ def SDM(self, model_name, mip_solver_options, dtiming, tee, verbose, sdm_iter_li
450450
gamma_t = self._compute_gamma_t_objgap(cutoff, inner_bound, outer_bound)
451451
else:
452452
gamma_t = self._compute_gamma_t(cutoff, inner_bound)
453-
print(f"{model_name=}, {itr=}, {gamma_t=:.2e}, {FW_conv_thresh=:.2e}")
453+
# print(f"{model_name=}, {itr=}, {gamma_t=:.2e}, {FW_conv_thresh=:.2e}")
454454

455455
# tbcol = time.perf_counter()
456456
self._add_QP_column(model_name)
@@ -490,7 +490,7 @@ def SDM(self, model_name, mip_solver_options, dtiming, tee, verbose, sdm_iter_li
490490
dual_bound = mip._mpisppy_data.outer_bound
491491

492492
if itr + 1 == sdm_iter_limit or not mip._mpisppy_data.solution_available or gamma_t < FW_conv_thresh:
493-
print(f"\tSTOPPING: {model_name=}, {itr=}, {gamma_t=:.2e}, {FW_conv_thresh=:.2e}")
493+
# print(f"\tSTOPPING: {model_name=}, {itr=}, {gamma_t=:.2e}, {FW_conv_thresh=:.2e}")
494494
return dual_bound
495495
else:
496496
yield dual_bound
@@ -912,8 +912,10 @@ def _setup_shared_column_generation(self):
912912
self._xhatter.post_iter0()
913913

914914
def _generate_initial_columns_if_needed(self):
915+
if self.FW_options["objgap_mode"]:
916+
return
915917
if self.spcomm is not None:
916-
if self.spcomm.receive_field_spcomms[Field.BEST_XHAT]:
918+
if self.FW_options.get("add_cylinder_columns", False) and self.spcomm.receive_field_spcomms[Field.BEST_XHAT]:
917919
# we'll get the initial columns from the incumbent finder spoke
918920
return
919921
number_initial_column_tries = self.options.get("FW_initialization_attempts", 10)

mpisppy/utils/cfg_vanilla.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,7 @@ def _fwph_options(cfg):
991991
"objgap_decrease_base" : cfg.fwph_objgap_decrease_base,
992992
"objgap_decrease_coeff" : cfg.fwph_objgap_decrease_coeff,
993993
"objgap_initial_floor" : cfg.fwph_objgap_initial_gap_floor,
994+
"add_cylinder_columns" : cfg.fwph_add_cylinder_columns,
994995
}
995996

996997
# Separate MIP/QP solvers (issue #712). FWPH falls back to solver_name

mpisppy/utils/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,11 @@ def fwph_args(self):
950950
domain=float,
951951
default=1)
952952

953+
self.add_to_config("fwph_add_cylinder_columns",
954+
description="Inject columns calculated by xhat spokes into the FWPH algorithm",
955+
domain=bool,
956+
default=False)
957+
953958
def cg_args(self):
954959

955960
self.add_to_config(name="cg_hub",

0 commit comments

Comments
 (0)