Skip to content

Enable parallel big-M calculation for gdp.mbigm transformation #3641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Aug 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2e2cb24
fix a bug in bigm_mixin
sadavis1 Jun 6, 2025
72003c4
non-working attempt at threaded mbigm
sadavis1 Jun 6, 2025
526bca4
Working attempt at parallel mbigm when using baron, but leads to a de…
sadavis1 Jun 9, 2025
69b22ce
delete unused code
sadavis1 Jun 9, 2025
cf09d52
Improve several edge cases
sadavis1 Jun 10, 2025
89218cf
Handle edge cases "better"
sadavis1 Jun 11, 2025
cdb0103
Handle ipopt in a somewhat better way
sadavis1 Jun 12, 2025
160fc22
apply black
sadavis1 Jun 12, 2025
83a2a20
apply black on more files
sadavis1 Jun 12, 2025
2e5e07e
Cleanup and formatting
sadavis1 Jun 12, 2025
21ea319
black yet again
sadavis1 Jun 12, 2025
523bbaa
Merge branch 'main' of github.com:Pyomo/pyomo into mbigm-parallel
sadavis1 Jun 12, 2025
c9794a5
Switch from multithreading to multiprocessing
sadavis1 Jun 18, 2025
a2d52cf
fix a bug, also reflow my block comments
sadavis1 Jun 18, 2025
2ff8888
Merge branch 'main' of github.com:Pyomo/pyomo into mbigm-parallel
sadavis1 Jun 18, 2025
738223b
Import plugins manually, also remove unused imports
sadavis1 Jun 18, 2025
bb7a816
remove debug code
sadavis1 Jun 18, 2025
1c0bb3e
Set 'name' class attribute of LegacySolver objects to the legacy name
sadavis1 Jun 20, 2025
d57501d
Consider and fix more edge cases
sadavis1 Jun 20, 2025
2de93fb
Test process spawning methods
sadavis1 Jun 20, 2025
2c5d3e5
reorder some imports
sadavis1 Jun 20, 2025
bcbb9ab
Revert "Set 'name' class attribute of LegacySolver objects to the leg…
sadavis1 Jun 24, 2025
edc0f30
Pickle classes instead of passing solver names
sadavis1 Jun 24, 2025
9e93f17
Move thread pool setup out of _transform_DisjunctionDatas
sadavis1 Jun 24, 2025
c37d305
check for a rather implausible error case
sadavis1 Jun 30, 2025
a65467e
terminate subprocesses more gently in an attempt to make codecov work
sadavis1 Jun 30, 2025
ffe3a5e
Merge branch 'main' of github.com:Pyomo/pyomo into mbigm-parallel
sadavis1 Jun 30, 2025
56d12ed
reduce lines of code
sadavis1 Jun 30, 2025
547e800
Merge branch 'main' of github.com:Pyomo/pyomo into mbigm-parallel
sadavis1 Jun 30, 2025
e14f0e2
Address review comments
sadavis1 Jul 22, 2025
bfe2809
Merge branch 'main' of github.com:Pyomo/pyomo into mbigm-parallel
sadavis1 Jul 22, 2025
c5a1e9f
apply kwargs from CONFIG to apply_to documentation
sadavis1 Jul 22, 2025
4b303f8
apply black
sadavis1 Jul 22, 2025
7d3ffd9
Merge branch 'main' into mbigm-parallel
jsiirola Aug 1, 2025
fb5e4c1
Update to use new document_class_CONFIG decorator
jsiirola Aug 1, 2025
79e7576
NFC: update docs so doc= is self-contained
jsiirola Aug 1, 2025
77bc5c0
NFC: move references into the bibliography
jsiirola Aug 1, 2025
e5fd3f2
Prevent str domains from triggering UninitializedConfig* resolution
jsiirola Aug 4, 2025
2b2a423
NFC: fixing some doc typos
jsiirola Aug 4, 2025
55ced91
Merge branch 'main' into mbigm-parallel
jsiirola Aug 4, 2025
418ef42
Merge branch 'main' into mbigm-parallel
mrmundt Aug 5, 2025
630b0ea
Fixing a docstring typo
emma58 Aug 5, 2025
9a7c7a5
Fixing a lot of variables that should have been snake case
emma58 Aug 5, 2025
1790bbf
skipping tests when dill isn't available
emma58 Aug 5, 2025
b993d07
Adding missing arg in docstring
emma58 Aug 5, 2025
b47d610
Merge branch 'main' into mbigm-parallel
jsiirola Aug 6, 2025
611f4bd
Guarding a test against gurobi direct being unavailable even when gur…
emma58 Aug 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/OnlineDocs/reference/bibliography.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,9 @@ Bibliography
Models for Non-separable Piecewise Linear Optimization: Unifying
framework and Extensions", *Operations Research* 58(2), 303-315. 2010.

.. [Vie15] J. P. Vielma. "Mixed Integer Linear Programming Formluation
Techniques", *SIAM Review*, 57(1), 3-57. 2015. DOI
`10.1137/130915303 <https://doi.org/10.1137/130915303>`_

.. [NW99] Nocedal, Jorge, and Stephen J. Wright, eds. Numerical
optimization. New York, NY: Springer New York, 1999.
11 changes: 8 additions & 3 deletions pyomo/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ class UninitializedMixin(object):
attempt to access the ``_data`` will trigger the initialization of the
Config object from its ``_default`` value. Setting the ``_data``
attribute will also trigger resolution of the Config object, but
without processing the ``_default__``.
without processing the ``_default``.

"""

Expand Down Expand Up @@ -1449,7 +1449,7 @@ def _data(self, value):
# recursively lookup the _data attribute and the second lookup
# will resolve to normal attribute assignment).
#
# We first encountered this issue for Config objects stores as
# We first encountered this issue for Config objects stored as
# class attributes (i.e., the default Config for something like
# a solver or writer) and multiple threads were simultaneously
# creating instances of the class (each of which was resolving
Expand Down Expand Up @@ -1628,7 +1628,12 @@ def set_default_value(self, default):

def set_domain(self, domain):
self._domain = domain
self.set_value(self.value(accessValue=False))
# Note that the domain is generally a callable (type, function,
# or functor). However, ConfigDict can also have a str domain
# (because ConfigDict doesn't need/use an actual domain for
# validation, we re-use that slot to *document* the domain).
if domain.__class__ is not str:
self.set_value(self.value(accessValue=False))

def _cast(self, value):
if value is None:
Expand Down
6 changes: 5 additions & 1 deletion pyomo/gdp/plugins/bigm_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________

import logging

from pyomo.gdp import GDP_Error
from pyomo.common.collections import ComponentSet
from pyomo.contrib.fbbt.expression_bounds_walker import ExpressionBoundsVisitor
import pyomo.contrib.fbbt.interval as interval
from pyomo.core import Suffix

logger = logging.getLogger(__name__)


def _convert_M_to_tuple(M, constraint, disjunct=None):
if not isinstance(M, (tuple, list)):
Expand All @@ -23,7 +27,7 @@ def _convert_M_to_tuple(M, constraint, disjunct=None):
else:
try:
M = (-M, M)
except:
except Exception:
logger.error(
"Error converting scalar M-value %s "
"to (-M,M). Is %s not a numeric type?" % (M, type(M))
Expand Down
Loading
Loading