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

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 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
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
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('pyomo.gdp.bigm')


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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You touched this line so now I get to snark. It's good practice, if catching a general exception, to raise the original exception as well so folks can directly inspect it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already do this? There is a raise statement after we log.

logger.error(
"Error converting scalar M-value %s "
"to (-M,M). Is %s not a numeric type?" % (M, type(M))
Expand Down
Loading
Loading