-
Notifications
You must be signed in to change notification settings - Fork 81
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
Catch [CTRL+C] and gracefully exit #349
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
odow
changed the title
WIP: Catch [CTRL+C] and gracefully exit
Catch [CTRL+C] and gracefully exit
Sep 29, 2020
Barring objections, I'll leave this open for another 48 hours, then merge. |
Works for me too with your example julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
julia> MOI.optimize!(model)
Gurobi Optimizer version 9.0.3 build v9.0.3rc0 (linux64)
Optimize a model with 3192 rows, 8856 columns and 38304 nonzeros
Model fingerprint: 0xb5c0f40e
Variable types: 0 continuous, 8856 integer (0 binary)
Coefficient statistics:
Matrix range [1e+00, 1e+00]
Objective range [2e+00, 1e+02]
Bounds range [0e+00, 0e+00]
RHS range [1e+00, 1e+00]
Presolve time: 0.08s
Presolved: 3192 rows, 8856 columns, 38304 nonzeros
Variable types: 0 continuous, 8856 integer (8856 binary)
Found heuristic solution: objective 724.0000000
Root simplex log...
Iteration Objective Primal Inf. Dual Inf. Time
19534 3.5605418e+02 1.925783e+05 0.000000e+00 5s
29944 4.2440709e+02 2.400263e+05 0.000000e+00 10s
36504 4.5645955e+02 1.263004e+05 0.000000e+00 15s
42934 4.7864415e+02 4.219360e+03 0.000000e+00 20s
49554 4.9218340e+02 7.402823e+04 0.000000e+00 25s
55524 5.0254681e+02 6.533896e+04 0.000000e+00 30s
61624 5.0807071e+02 2.470515e+05 0.000000e+00 35s
67314 5.1246736e+02 5.730068e+02 0.000000e+00 40s
72334 5.1533665e+02 1.126381e+03 0.000000e+00 45s
^C
Root relaxation: interrupted, 76764 iterations, 48.21 seconds
Nodes | Current Node | Objective Bounds | Work
Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time
0 0 - 0 724.00000 0.00000 100% - 48s
Explored 0 nodes (76764 simplex iterations) in 48.33 seconds
Thread count was 8 (of 8 available processors)
Solution count 1: 724
Solve interrupted
Best objective 7.240000000000e+02, best bound 0.000000000000e+00, gap 100.0000%
User-callback calls 1348, time in user-callback 0.01 sec
julia> MOI.get(model, MOI.TerminationStatus())
INTERRUPTED::TerminationStatusCode = 23
julia> MOI.get(model, MOI.RawStatusString())
"Optimization was terminated by the user." |
blegat
approved these changes
Oct 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #52
Closes #53
An updated attempt at #52, inspired by #53.
Does anyone watching this repository have access to a Windows machine they could test this on?
Throwing an interrupt from a callback worked, but on Mac, I could not get a script to exit correctly on CTRL+C. I have to hold down CTRL+C to force a SIGINT, and then I get a Gurobi Error 10017,
OPTIMIZATION_IN_PROGRESS
.Here is the script I was running:
I'll reach out to Gurobi support. Not sure if this is publicly accessible, but here is the support ticket: https://support.gurobi.com/hc/en-us/requests/12868.