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.
This comment also appears to be wrong.
There was a problem hiding this comment.
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. |
blnicho
left a comment
There was a problem hiding this comment.
I have a couple questions but nothing major enough to prevent merging
| CONFIG.declare( | ||
| 'solver', | ||
| ConfigValue( | ||
| default=SolverFactory('gurobi'), |
There was a problem hiding this comment.
Now that #3394 has been merged can the changes in this file be reverted?
There was a problem hiding this comment.
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.
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.shscript, 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_directis significantly less performant than the current LP shell interfacegurobi_directhas a slightly different APIpyomo.solvers"soon"Instead, this PR adds a new solver that is a relatively thin veneer around the
GUROBISHELLinterface 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: