Updating options in Ipopt

Is it possible to easily update the options used in Ipopt?
Trying to change the value of mu using the :mu_init option but it seems that Ipopt uses an immutable struct so I don’t have access. I used it in Julia v0.6 and it was a good speed up for the MINLP solver Juniper.jl

In general I think it should be maybe a function in MathProgBase/MOI to easily update options of each solver in a generalized way?
FYI currently just updating to julia version 1.0 and not MOI (so it might be different there)

Do you mean that it used to work in Julia 0.6 and doesn’t work anymore in 1.0?

Definitely. This is easy to do in MOI (but not implemented yet). We’re not going to be making API changes to MathProgBase anymore.

1 Like

The structure of the options seemed to have changed quite a bit by having an iterator over pairs instead of a vector or something like this.
Anyway actually I’m a little confused that it was possible before as I set it using
push!(m.nl_solver.options, (:mu_init, 1e-5)) or overwritting it if present.
where m.nl_solver.options are the options of Ipopt but it was a struct back then as well and not a mutuable struct.
In my understanding it should have raised an error before. :confused:

Immutability doesn’t prevent you from modifying an array that’s stored as a field in a struct.

Yes, the structure for the parameters changed unintentionally because the processing of keyword arguments changed. We’ll accept a PR that changes this structure back to a vector of tuples to make it easier to modify to restore the previous functionality.

1 Like

PR at: https://github.com/JuliaOpt/Ipopt.jl/pull/147
This only changes it for MPB as you wrote that there will be another option in MOI later anyway.