Skip to content

Commit

Permalink
Merge branch 'main' into lp_writer
Browse files Browse the repository at this point in the history
  • Loading branch information
DLWoodruff authored Dec 15, 2024
2 parents dee4997 + 9d86577 commit eb8410e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions mpisppy/cylinders/reduced_costs_spoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ def lagrangian_prep(self):
self.opt.PH_Prep(attach_prox=False)
self.opt._reenable_W()

if self.opt._presolver is not None:
# do this before we relax the integer variables
self.opt._presolver.presolve()

relax_integer_vars = pyo.TransformationFactory("core.relax_integer_vars")
for s in self.opt.local_subproblems.values():
relax_integer_vars.apply_to(s)
Expand Down
11 changes: 7 additions & 4 deletions mpisppy/spopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ def __init__(
self._save_active_objectives()
self._subproblem_creation(options.get("verbose", False))
if options.get("presolve", False):
self._presolver = SPPresolve(self)
self._presolver.presolve()
else:
self._presolver = None
# NOTE: This creates another representation
# of each scenario subproblem in C++
# to presolve the model on. For large
# models, it is imperative we allow this
# object to get garbage collected to
# free the memory the C++ model uses.
SPPresolve(self).presolve()
self.current_solver_options = None
self.extensions = extensions
self.extension_kwargs = extension_kwargs
Expand Down

0 comments on commit eb8410e

Please sign in to comment.