-
Notifications
You must be signed in to change notification settings - Fork 522
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
Move away from dependence on gurobi.sh #3384
Conversation
# translate the options into a normal python dictionary, from a | ||
# pyutilib SectionWrapper - the gurobi_run function doesn't know | ||
# about pyomo, so the translation is necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment also appears to be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - this is still correct. I updated the comment to clarify it a bit.
The test failures in Jenkins are real; however, I need #3394 to resolve the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple questions but nothing major enough to prevent merging
@@ -127,7 +135,8 @@ class MultipleBigMTransformation(GDP_to_MIP_Transformation, _BigM_MixIn): | |||
CONFIG.declare( | |||
'solver', | |||
ConfigValue( | |||
default=SolverFactory('gurobi'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that #3394 has been merged can the changes in this file be reverted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I just noticed the last commit message which seems to already be using the deferred config stuff so ignore my original question. Is the Solver
domain implemented here general enough to go into pyomo.common
or pyomo.util
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is pretty general, but could use some discussion before promulgating it elsewhere. In particular, what is the "correct" way to know if you were handed a "solver" object? Given that we have 3 different base classes floating around (core, APPSI, and contrib/solver), inheritance is probably not the right answer. This implementation just looks for a solve()
method and hopes it quacks.
Fixes #3285 .
Summary/Motivation:
Gurobi has deprecated the use of the
gurobi.sh
script, which is used by the default Pyomo interface to Gurobi. While we could have just changed the default interface togurobi_direct
, this PR does not go down that path because:gurobi_direct
is significantly less performant than the current LP shell interfacegurobi_direct
has a slightly different APIpyomo.solvers
"soon"Instead, this PR adds a new solver that is a relatively thin veneer around the
GUROBISHELL
interface that avoids the subprocess call and the need to write results to a "soln" file. While this is adding yet another interface, it offers a minimally-disruptive path to avoid the deprecation warnings that will appear in Gurobi 12.Changes proposed in this PR:
Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: