'Ctrl+C does not interrupt optimize!() regardless of solver

The problem pertains to JuMP, an optimization package for Julia. I realize this problem is likely specific to my machine; however, I have tried many of the obvious remedies with no luck.

When I run a JuMP model using optimize!(), I cannot interrupt the execution using ctrl+C. When I press ctrl+C, the REPL completely ignores the input. This is true regardless of solver. I have experienced this with Gurobi, Cbc, and GLPK. While I'm uncertain about Cbc and GLPK, I know that support for graceful interruption is supposed to be implemented in Gurobi.jl (https://github.com/jump-dev/Gurobi.jl/pull/349). Meanwhile, other julia code can be interrupted with ctrl+C using the same REPL (and even the same .jl file).

What I can try to fix this?



Solution 1:[1]

Terminating external C code in Julia is difficult. GLPK and Cbc do not support it. Gurobi does, but not for LPs, and only at particular times. It may ignore the interrupt, if, for example, it is still solving the root node LP of a MIP.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Oscar Dowson