I wonder if it is possible to access the exit of a solver directly from JuMP0, i.e. the exit we get when not setting the JuMP model in silent as shown in the screenshot below. I would really appreciate it if you could provide me some hints on this.
You can do this in a solver-independent fashion using:
termination_status(model)
In this case, the return should be INVALID_MODEL, and it likely means you have something like log(x) where x <= 0 in your model.
I don’t know if there is an easy way to access the exact string. After solving, you can access the MadNLP.Optimizer object with mad = unsafe_backend(model). You’d have to explore. Perhaps mad.result.status.
Hi,
The reason I asked is because sometimes termination_status(model) does not work, in a sense that it does not give INVALID_MODEL but instead MethodError: Cannot 'convert' an object of type MathOptInterface.ResultStatusCode to an object of type MathOptInterface.TerminationStatusCode. That was what happened when I tried this example:
using JuMP, MadNLP
m = Model(MadNLP.Optimizer)
@variable(m, x)
@variable(m, y)
@NLobjective(m, Min, (x-5)^2 + (y-8)^2)
@NLconstraint(m, x*y==5)
optimize!(m)
println(termination_status(model))