Closed JackDunnNZ closed 4 years ago
No clue here, @joehuchette?
If Gurobi has an analogue to cpxsetterminate
, then yeah the approach I took with CPLEX should work here as well. grbterminate looks like it might do the job.
(Related: https://groups.google.com/forum/#!topic/gurobi/n0CNeAe91VU)
Cool thanks, I'll have a crack at it.
I'm guessing it'll be even easier than what I had to do in CPLEX, since you can just call grbterminate
directly in @grb_ccall_intercept
instead of carrying around extra state in the model object...
I copied in the same macro and changed it to use grbterminate
, but it's never catching the exception, it just dies. Any ideas? It catches the exception if I just set up an infinite loop before the solve and ctrl-c out of that, but as soon as it enters grboptimize
it doesn't seem to catch it.
Change here, not that it's more than a copy/paste... https://github.com/JuliaOpt/Gurobi.jl/commit/16c3f714a7bf5547ead0415c98aeacaf679b151a
@mlubin You were right, what I have works fine as is on Ubuntu so it must be an OS X problem
Is it possible to give Gurobi the same magic as JuliaOpt/CPLEX.jl#45 so that it doesn't segfault on ctrl-c? I'm happy to have a go if needed, but it might be easier for someone that understands the internals better than I do.
Related, I've been working with a model given to me that uses gurobipy, and on that, ctrl-c interrupts the solve and returns the current incumbent. I'm not sure if that would fall out here as a consequence, but it would be pretty cool if it worked!