-
Notifications
You must be signed in to change notification settings - Fork 80
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
Add fake termination status to Gurobi (so it become compliant with MOI.MEMORY_LIMIT) #398
Conversation
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.
Nice. Are there any other return codes we should catch?
src/MOI_wrapper.jl
Outdated
# to Gurobi "Status" and instead we return the appropriate | ||
# `MOI.TerminationStatus`. Just before calling `GRBoptimize` we change | ||
# this to zero again. | ||
fake_termination_status::Cint |
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.
ret_GRBoptimize::Cint
?
Are you on a new release of Gurobi? Good to see they fixed it. |
Sorry, fixed what exactly? The Farkas dual? I am using Gurobi 9.1.1. |
There was a bug in Gurobi. But they fixed it which is why you now see "Got correct result" |
About the changes, I have no problem with the purely stylistic ones, and will probably make a new commit soon to solve them. However, some of the changes of names and how conditionals are done are pointing could be looked at with a little more attention.
Its seems to me that, instead of making this field only for the error codes that may be interpreted as |
Sure. |
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.
Looks good.
This PR intends to solve #397. The PR creates a generic mechanism that allows Gurobi Error Codes to interpreted as termination status by the Gurobi wrapper. For now, it is used only for transforming
OUT_OF_MEMORY
inMOI.MEMORY_LIMIT
, but new conversions only need to add a new element to a global internal Dict. The mechanism consist in one extra field forGurobi.Optimizer
(calledfake_termination_status
), a new internal function_check_ret_GRBoptimize
, a new internal global_FAKE_TERMINATION_STATUS
, and changes to_raw_status
,Optimizer
(constructor),is_empty
,empty!
, andoptimize!
.The code is well commented. I did not add tests. If tests are deemed necessary, then I would like that someone more familiar with exception testing inside
Gurobi.jl
gave me some pointers.The current code give some errors:
but they are the same obtained in the master branch:
and probably should be fixed in other PR: