Skip to content
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

function optimize!(...) does not return JuMP termination status #22

Closed
etatara opened this issue Sep 28, 2020 · 3 comments
Closed

function optimize!(...) does not return JuMP termination status #22

etatara opened this issue Sep 28, 2020 · 3 comments

Comments

@etatara
Copy link

etatara commented Sep 28, 2020

in the plasmo solve.jl, the function function JuMP.optimize!(graph::OptiGraph,optimizer;kwargs...) always return an empty (nothing) status from the JuMP.optimize!(...) call. Using the JuMP.termination_status however does work as follows:

model = Plasmo.getmodel(optinode)
JuMP.set_optimizer(optinode,optimizer)
JuMP.optimize!(model)  #,optimizer;kwargs...)
status = JuMP.termination_status(model)

It would be nice to update this function as there's no other way to get the JuMP termination status of the model from the Plasmo.optimize!() functions.

@jalving
Copy link
Member

jalving commented Sep 29, 2020

Before the major transition to MOI, JuMP returned the status, which just got passed through to Plasmo.jl. I think in the short term, I will go ahead and cache a reference to the underlying JuMP model that gets constructed in an optigraph. Then we can just write a few functions to get termination_status, primal_status, etc... that will work for an optigraph. I should be able to update the master branch to try out this week.

One of the improvements I would like to make is to make a more direct interface to MathOptInterface. This would also make model construction faster when using standard solvers. We can always keep the option to build a JuMP model too.

@jalving
Copy link
Member

jalving commented Oct 5, 2020

I went ahead and added JuMP.termination_status(::OptiGraph). I also added primal_status,dual_status, and raw_status for convenience. All of these functions just reference the internal optinode model that gets built during aggregation. You can access the internal model with getmodel(::OptiGraph) after you run optimize!

You can also look at the current optinode and reference map in the optigraph obj_dict after you run optimize!. The reference map is mapping between variables and constraints created on optinodes to the variables and constraints in the internal model.

I updated to v0.3.2. You should be able to just update to try it out.

@jalving
Copy link
Member

jalving commented Dec 18, 2020

Closing now that optigraph uses termination status.

@jalving jalving closed this as completed Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants