Tobias Achterberg
unread,Apr 27, 2017, 4:05:06 AM4/27/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gur...@googlegroups.com
As you have guessed, Gurobi listens to the SIGINT signal, using
signal(SIGINT, our_signal_handler);
But it only does so when used through the command line tool gurobi_cl. If you
call Gurobi from your own program via the library, then you can catch this
signal yourself and call GRBterminate(model) from your signal handler.
The implementation in the Python shell is a little bit different.
If you are using gurobi_cl on your SLURM cluster and sending the signal does not
work, then something weird seems to go on, which I don't understand right now.
It should work. But note that sometimes it can take a while until Gurobi reacts
to the signal because it only checks the termination flag at certain points in
the algorithm where it is possible to exit gracefully. This should usually be
often enough to interrupt almost immediately, but there are counter-examples, in
particular for very large models.
Regards,
Tobias