Skip to content

FAQ: In MATLAB I cannot stop the optimization with Ctrl C, what to do?

András Retzler edited this page Oct 21, 2022 · 3 revisions

In this case, unfortunately you need to restart MATLAB.
If anyone has a clever hack for stopping a running MEX file, please add that here.
See also: FAQ: How to debug it if the optimization would hang? to figure out what causes the hang.

More details

One thing that can cause such a hang is a bug inside Ipopt / MUMPS. CasADi already handles Ctrl+C signals through utIsInterruptPending() in between Ipopt iterations, but if an iteration does not return to CasADi, it cannot do much. In addition, apparently MATLAB cannot stop the running MEX functions. In case the function does not return to CasADi from Ipopt, it is not possible to handle it on the CasADi level.

For MUMPS, updating to the latest version of the solver shall help see: FAQ: Where do I find the very latest CasADi version?

Clone this wiki locally