IPOPT: getting major iterations info
Description of feature
Add a capability to the IPOPT wrapper so that it gets the major iterations info, including objective, (primal) infeasibility, optimality (which appears as dual infeasibility).
Potential solution
I will try to do this.
This bug is reported as #182 .
Also, there seems to be a bug in the current history recorder. Objective and constraint calls seem to be recorded duplicately when they're called at the same x. As a result, the optimization history plot has more number of iterations in abscissa than the actual number of iteraions.
I don't follow what you mean here, can you elaborate? An example might be helpful too.
When the optimizer evaluates the objective and constraint at a point x, it should be recorded as a single iteration. But it seems that it's recorded as two iterations with the same variable/function values.
In the end, for example, IPOPT.out says it finished after 100 objective evaluations and 100 constraint evaluations, whereas I see 200 iterations in the OptView plot.
Okay I see what you mean now, and I can confirm that I can reproduce the issue. Would you mind opening a bug report on this? The history file for IPOPT seems a bit messed up, for example isMajor is always set to False somehow, and I'd like to get that sorted. Would you be willing to look into this issue? If not I'd be happy to try and fix this.
Sure, I will open another issue and try to fix it (most likely will ask you questions on the way!)
To add to this, this information is provided by IPOPT via intermediate_callback, which already has a wrapper within pyOptSparse.
@kanekosh did you end up looking into how to extract info from IPOPT? we might get more people involved this time
I didn't have time to work on this. And I'm a bit ashamed but I don't remember what exactly I meant by "major iterations" for IPOPT. I suppose line search calls vs calls that determine search direction. As far as I understand, IPOPT calls f, c, df/dx, dc/dx in the latter, but it only calls function evaluations (no gradients) in line search. Therefore we could use this fact to detect in the hist file whether each call is of line search or not.
I was thinking to use intermediate_callback to extract iter, in the same way we extract major iteration number in SNSTOP for SNOPT.