Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault on ctrl-c #52

Closed
JackDunnNZ opened this issue Mar 4, 2016 · 6 comments · Fixed by #349
Closed

Segfault on ctrl-c #52

JackDunnNZ opened this issue Mar 4, 2016 · 6 comments · Fixed by #349
Labels
Wrapper: C API Issue is specific to low-level C API

Comments

@JackDunnNZ
Copy link
Contributor

Is it possible to give Gurobi the same magic as jump-dev/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!

@mlubin
Copy link
Member

mlubin commented Mar 4, 2016

No clue here, @joehuchette?

@joehuchette
Copy link
Contributor

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)

@JackDunnNZ
Copy link
Contributor Author

Cool thanks, I'll have a crack at it.

@joehuchette
Copy link
Contributor

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...

@JackDunnNZ
Copy link
Contributor Author

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... 16c3f71

@JackDunnNZ
Copy link
Contributor Author

@mlubin You were right, what I have works fine as is on Ubuntu so it must be an OS X problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Wrapper: C API Issue is specific to low-level C API
Development

Successfully merging a pull request may close this issue.

4 participants