Any way to cancel a solve. #198
-
Hello, I've search through the documentation after a way to cancel the run gracefully between iterations or at other times. Is it possible to do this? Note that I'm not thinking about the max time or max iteration count setting, more in the lines of a flag to set that clp watches or callback functionality that can stop the process. For example, the user of my program wants to be able to cancel during a solve without resorting to stopping threads or similar. So if there is a way to gracefully cancel for example between iterations that would be great. I wondered if you could try to set max iteration count to 0 or 1 in order to stop it but that seems like it could cause some problems, if it's even possible. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Haven’t tried this, but take a look at ClpEventHandler and the example in MyEventHandler. Does that help? |
Beta Was this translation helpful? Give feedback.
-
It's not clear to me exactly what you're after, but Clp does have a signal handler, so ctrl-c seems to do what you want. It will exit gracefully and print out partial results. |
Beta Was this translation helpful? Give feedback.
Haven’t tried this, but take a look at ClpEventHandler and the example in MyEventHandler. Does that help?