Extracting Number of iterations for IPOPT

Skip to first unread message

Ashlesha Tiple

Mar 17, 2022, 11:41:35 AM3/17/22
to Pyomo Forum
Hello everyone,
I am trying to compare few models based on the number of iterations it required to get the optimal solution. How do I extract the number of iterations from the IPOPT solver?
Thank you


Mar 25, 2022, 8:04:49 AM3/25/22
to Pyomo Forum
I'd really like to know this too

Michael Bynum

Mar 25, 2022, 9:02:29 AM3/25/22
to Pyomo Forum
There are a couple ways to do this. Unfortunately, neither is trivial. One way to do this would be to parse the log file. You can access the log file by specifying the name of the log file in the call to solve: results = solver.solve(model, logfile='ipopt_output.log'). You can then open this log file and parse it to get the number of iterations. Alternatively, you could use the interface to CyIpopt with a callback to track the number of iterations.


Esteban Daniel Gonzalez Iakl

Jun 16, 2023, 12:41:42 PMJun 16
to Pyomo Forum
Hi, have you found a solution for this issue, easier than parsing the log file? Im looking into this too.
Reply all
Reply to author
0 new messages