Skip to content

Commit e388dd5

Browse files
committed
try generating lots of points to start
1 parent af67dea commit e388dd5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Diff for: mpisppy/opt/fwph.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def fw_prep(self):
107107
self._MIP_nonants = {}
108108

109109
if self.FW_options["FW_iter_limit"] == 1:
110-
success = self._generate_starting_point()
111-
if not success:
110+
number_points = self._generate_starting_point()
111+
if number_points == 0:
112112
global_toc(f"{self.__class__.__name__}: Warning: FWPH failed to find an initial feasible solution. Increasing FW_iter_limit to 2 to ensure convergence")
113113
self.FW_options["FW_iter_limit"] = 2
114114

@@ -708,9 +708,12 @@ def _generate_starting_point(self):
708708
stage2EFsolvern = self.options.get("stage2EFsolvern", None)
709709
branching_factors = self.options.get("branching_factors", None) # for stage2ef
710710

711-
for _ in range(self.options.get("FW_initialization_attempts", 3)):
711+
number_points = 0
712+
for _ in range(self.options.get("FW_initialization_attempts", 20)):
712713
# will save in best solution
713714
snamedict = scenario_cycler.get_next()
715+
if snamedict is None:
716+
return number_points
714717
obj = xhatter._try_one(snamedict,
715718
solver_options = self.options["mip_solver_options"],
716719
verbose=False,
@@ -720,10 +723,10 @@ def _generate_starting_point(self):
720723
if obj is not None:
721724
for model_name in self.local_subproblems:
722725
self._add_QP_column(model_name)
723-
self._restore_nonants()
724-
return True
726+
# self._restore_nonants()
727+
number_points += 1
725728
self._restore_nonants()
726-
return False
729+
return number_points
727730

728731
def _is_timed_out(self):
729732
if (self.cylinder_rank == 0):

0 commit comments

Comments
 (0)