IPOPT Watchdog Iterations Tracking

In IPOPT.jl, is there any way to obtain the diagnostic information or alpha_pr?

The callback function example given in repo is:

function my_callback(
   alg_mod::Cint,
   iter_count::Cint,
   obj_value::Float64,
   inf_pr::Float64,
   inf_du::Float64,
   mu::Float64,
   d_norm::Float64,
   regularization_size::Float64,
   alpha_du::Float64,
   alpha_pr::Float64,
   ls_trials::Cint,
)
[...]

From the readme of Ipopt.jl: “See the Ipopt documentation for an explanation of the arguments to the callback. They are identical to the output contained in the logging table printed to the screen.”

This statement doesn’t seem to be strictly true. The Ipopt documentation for alpha_pr reads: " alpha_pr: The stepsize for the primal variables ( αk in Eq. (14a) in [12]). The number is usually followed by a character for additional diagnostic information regarding the step acceptance criterion:".

I don’t see a way to get that diagnostic information character. I don’t care about most of the diagnostic characters, but one that I often do care about is w, which indicates that optimization is “in watchdog precedure”. During a watchdog procedure, the objective function often increases greatly as the optimizer aggressively tests new search directions. When I plot the optimization history, I usually don’t want to plot these iterations, since the create large, vertical bands that make other lines on the graph impossible to see.

Currently, my workaround has been to use regex on the IPOPT log output to grab the diagnostic character for each iteration. It would be much more convenient to get this information in the callback function. Is there a way to do this?

I don’t believe so. Ipopt.jl can expose only what is provided by the C API:

1 Like

Thanks. That’s a little disappointing about the C API not including this info.