pyomo
pyomo copied to clipboard
Parse `noSolution` status from CPLEXShell and CPLEXDirect solvers correctly
Fixes
Summary/Motivation:
Currently when CPLEX returns "No Solution", this isn't captured in any of the Pyomo solution or solver data objects. We can identify "No Solution" because when both of (1) max time limit is reached and (2) the model is infeasible occur.
Changes proposed in this PR:
CPLEXDirect
- Clean up the status codes in
_postsolve()
to use the actual CPLEX library constants - Add new logic to handle
MIP_time_limit_infeasible
andMIP_dettime_limit_infeasible
as indicating a solvertermination_condition
ofnoSolution
- Get the solver return code if possible from any
CplexSolverError
s (but don't add this to the returnedBunch
due to downstream code raisingApplicationError
s) - Set
results.solver.return_code
andresults.solver.termination_message
using the available information
CPLEXSHELL
- Fix
process_logfile()
for CPLEX 12.10 as it looks like IBM have updated the log file schema and is no longer being parsed correctly - Add new logic to handle
'no integer solution.'
in the log file as indicating a solvertermination_condition
ofnoSolution
- Get the solver return code if possible from any
CPLEX Error
lines in the log file
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution:
- I agree my contributions are submitted under the BSD license.
- I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
Codecov Report
Merging #1313 into master will increase coverage by
1.17%
. The diff coverage is84.84%
.
@@ Coverage Diff @@
## master #1313 +/- ##
==========================================
+ Coverage 71.57% 72.75% +1.17%
==========================================
Files 547 491 -56
Lines 83583 79087 -4496
==========================================
- Hits 59821 57536 -2285
+ Misses 23762 21551 -2211
Impacted Files | Coverage Δ | |
---|---|---|
pyomo/solvers/plugins/solvers/CPLEX.py | 46.78% <80.00%> (-41.93%) |
:arrow_down: |
pyomo/solvers/plugins/solvers/cplex_direct.py | 74.72% <88.88%> (+1.62%) |
:arrow_up: |
pyomo/pysp/lagrangeMorePR.py | 5.54% <0.00%> (-68.98%) |
:arrow_down: |
pyomo/solvers/plugins/solvers/gurobi_direct.py | 12.67% <0.00%> (-58.28%) |
:arrow_down: |
pyomo/solvers/plugins/solvers/GUROBI.py | 31.61% <0.00%> (-57.42%) |
:arrow_down: |
pyomo/pysp/drive_lagrangian_cc.py | 9.38% <0.00%> (-48.36%) |
:arrow_down: |
pyomo/solvers/plugins/solvers/gurobi_persistent.py | 20.20% <0.00%> (-48.19%) |
:arrow_down: |
pyomo/opt/parallel/async_solver.py | 56.00% <0.00%> (-44.00%) |
:arrow_down: |
pyomo/solvers/plugins/solvers/SCIPAMPL.py | 24.39% <0.00%> (-39.64%) |
:arrow_down: |
... and 99 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update c3f888c...33b0b2d. Read the comment docs.
@ruaridhw It looks like the changes in #1300 are also included in this PR. However, the changes to the direct interface do not depend on the changes in #1300. If you do not want this PR to be held up by #1300, then I would recommend creating a PR with just the changes to the direct interface.
@michaelbynum, sorry about that. Branch is fixed now.
@michaelbynum, this should be ready to review whenever you get a chance
@ruaridhw Thanks. I will review these PRs early next week.
This PR is going to be superseded by work to complete #1030 - which builds in base support for "no solution" to all solver interfaces. As such, I am going to close this PR.