4

I have been having an issue with the display of the IPOPT solver in Gekko (python), since upgrading from version 0.2.0 scripts work as expected but there is no more live display in the console while the solver is working, solve(disp=true) doesn't change anything. I am running Ipython in spyder. Does anyone have a solution ? My scripts take about 10mins to run and it would be nice to see if it's failing to stop it earlier. thank you for your time

Adrien

AdrienB
  • 41
  • 1

1 Answers1

2

You can show the solver output, line-by-line when you change the solve option debug=2.

m.solve(disp=True,debug=2)

The change was made for local solves because Python couldn't handle the rate of text output for some problems and it was causing the buffer to fill and blocked the program from completing. There is an enhancement request on Github to enable the line-by-line output again by default. If your problem takes 10 minutes to complete, the buffer overfill shouldn't be a problem.

John Hedengren
  • 12,068
  • 1
  • 21
  • 25
  • 1
    Thank you for your quick response, i see that this feature makes sense for problems that run fast, i just tried both: m.solve(disp=True, debug=2) and m.options.DIAGLEVEL=2 separately, the second one runs with no line by line and gives a solution (makes sense becasue it's an apm option?), the debug=2 outputs the "----------------------" header line and then apm never stops. when i kill it (task manager) the usual output is visible – AdrienB Nov 22 '19 at 22:11
  • I think that is the buffer filling up and creating a lock when you have debug=2. Have you tried `m.options.DIAGLEVEL=0` and `debug=2`? There are some additional thoughts on how to make the line-by-line work with local solves on the Github link for tracking the issue. I'll try to revisit that again soon. It seems to be a popular option. – John Hedengren Nov 23 '19 at 00:12
  • debug = 2 doesn't work for some reason :( I tried DIAGLEVEL = 0, 1, and 2 – Aaron John Sabu Aug 09 '23 at 18:35
  • The only way to get line-by-line output is to use `remote=True`. There was a buffer overflow issue with `remote=False`. The output is still displayed, but it comes after the solver finds a solution. – John Hedengren Aug 10 '23 at 03:50