GUROBI+gurobipy crashes python interpreter

270 views
Skip to first unread message

sascha...@googlemail.com

unread,
Jan 20, 2015, 8:46:10 AM1/20/15
to gur...@googlegroups.com

Hi,

I’m using Gurobi 6.0 together with the bundled gurobipy python-api, called in "my own" python version: (before: Anaconda with Python 2.7.7 64bit; now: Anaconda/Miniconda 2.7.8 64bit like the bundled one -> both fail!) within Win7 64-bit.


My problem: Gurobi is crashing my python interpreter (no feedback about the error; feels like a segfault in some classic c-code).

As my code will generate and solve some problem within some loop, sometimes it crashes, sometimes it doesn't (at least i thought so until today, but today my error-rate is 100%; maybe i changed some parameters without noticing).

Interesting observation: it seems, that this crash is always happening, when gurobi is stopping/cleaning-up. I'm using a MIPGap of 0.01 and the last print of my python-code/gurobi is always some line describing a state with a MIPGap > 0.01 followed by all the cutting-plane statistics. Then it crashes! (Without further explanation: it feels like gurobi/gurobipy or something on a c/asm-level is doing something wrong, not my python code after the optimization-process).


So i got several questions:

1. Did someone experience something similar?

2. How should i proceed to handle my problem?

3. I know, that i should try the bundled python interpreter when observing problems like that, but: this will cost me so much time (if i even succeed), as all this big-stuff like numpy, scipy, matplotlib and much more isn't fun to install on windows (therefore i'm using Miniconda).

PLUS: the bundled interpreter (python 2.7 coming with Gurobi 6.0) even fails to install the official "get-pip.py" file ('No module named logging')


Any ideas?

Thanks in advance

 

Sascha

Greg Glockner

unread,
Jan 20, 2015, 9:08:18 AM1/20/15
to gur...@googlegroups.com
> Interesting observation: it seems, that this crash is always happening, when gurobi is stopping/cleaning-up. I'm using a MIPGap of 0.01 and the last print of my python-code/gurobi is always some line describing a state with a MIPGap > 0.01 followed by all the cutting-plane statistics. Then it crashes! (Without further explanation: it feels like gurobi/gurobipy or something on a c/asm-level is doing something wrong, not my python code after the optimization-process).

Can you explain more about this? Put another way, can you add more logging to your Python program and find the exact lines of your Python code where the problem occurs?

sascha...@googlemail.com

unread,
Jan 20, 2015, 11:10:28 AM1/20/15
to gur...@googlegroups.com
Sure thing,

Python-Code:
--------------------
 print 'Statistics'
 model
.printStats()
 model
.setParam('Presolve', 2)
 model
.setParam('PreSparsify', 1)
 model
.setParam('Threads',1)
 model
.setParam('MIPGap',0.01)
 
print 'DEBUG: pre-optimize'
 model
.optimize()
 
print 'DEBUG: optimized'

Partial output:
--------------------
DEBUG: pre-optimize
Optimize a model with 146890 rows, 256200 columns and 14177912 nonzeros
Coefficient statistics:
 
Matrix range    [1e+00, 9e+04]
 
Objective range [2e+00, 8e+01]
 
Bounds range    [1e+00, 9e+04]
  RHS range      
[1e+00, 2e+04]
Presolve removed 106491 rows and 183759 columns (presolve time = 5s) ...
Presolve removed 118187 rows and 200120 columns (presolve time = 10s) ...
Presolve removed 118190 rows and 200120 columns (presolve time = 23s) ...
Presolve removed 118190 rows and 200120 columns (presolve time = 25s) ...
Presolve removed 118190 rows and 206028 columns (presolve time = 30s) ...
Presolve removed 118190 rows and 206028 columns (presolve time = 35s) ...
Presolve removed 122959 rows and 209518 columns (presolve time = 49s) ...
Presolve removed 122959 rows and 209518 columns (presolve time = 50s) ...
Presolve removed 122959 rows and 209518 columns (presolve time = 55s) ...
Presolve removed 122959 rows and 209518 columns (presolve time = 63s) ...
Sparsify removed 297354 nonzeros (69%)
Presolve removed 130129 rows and 223661 columns
Presolve time: 64.65s
Presolved: 16761 rows, 33146 columns, 94580 nonzeros
Variable types: 16698 continuous, 16448 integer (16448 binary)
Presolve removed 2481 rows and 4952 columns
Presolved: 14280 rows, 28194 columns, 84687 nonzeros




Root simplex log...


Iteration    Objective       Primal Inf.    Dual Inf.      Time
       
0    6.3270147e+06   6.531195e+03   0.000000e+00     66s
   
1037    8.5616515e+06   0.000000e+00   0.000000e+00     66s
   
1037    8.5616515e+06   0.000000e+00   0.000000e+00     66s


Root relaxation: objective 8.561652e+06, 1037 iterations, 0.17 seconds


   
Nodes    |    Current Node    |     Objective Bounds      |     Work
 
Expl Unexpl |  Obj  Depth IntInf | Incumbent    BestBd   Gap | It/Node Time


     
0     0 8561651.53    0   33          - 8561651.53      -     -   65s
     
0     0 8571006.17    0   48          - 8571006.17      -     -   66s
     
0     0 8576333.26    0   50          - 8576333.26      -     -   66s
     
0     0 8577856.68    0   51          - 8577856.68      -     -   66s
     
0     0 8578325.69    0   53          - 8578325.69      -     -   67s
     
0     0 8580278.10    0   54          - 8580278.10      -     -   67s
H    
0     0                    9080499.4049 8580278.10  5.51%     -   67s
     
0     0 8580333.49    0   53 9080499.40 8580333.49  5.51%     -   67s
     
0     0 8581063.01    0   50 9080499.40 8581063.01  5.50%     -   67s
     
0     0 8582869.40    0   57 9080499.40 8582869.40  5.48%     -   68s
     
0     0 8582925.31    0   55 9080499.40 8582925.31  5.48%     -   68s
     
0     0 8583007.76    0   59 9080499.40 8583007.76  5.48%     -   68s
     
0     0 8583007.76    0   54 9080499.40 8583007.76  5.48%     -   70s
H    
0     0                    9000117.6990 8583007.76  4.63%     -   70s
H    
0     0                    8990009.3356 8583007.76  4.53%     -   71s
     
0     0 8583007.76    0   33 8990009.34 8583007.76  4.53%     -   73s
     
0     0 8583007.76    0   52 8990009.34 8583007.76  4.53%     -   73s
     
0     0 8583007.76    0   52 8990009.34 8583007.76  4.53%     -   73s
     
0     0 8583007.76    0   60 8990009.34 8583007.76  4.53%     -   73s
     
0     0 8583486.94    0   55 8990009.34 8583486.94  4.52%     -   74s
     
0     0 8583637.61    0   53 8990009.34 8583637.61  4.52%     -   74s
     
0     0 8583978.29    0   63 8990009.34 8583978.29  4.52%     -   74s
     
0     0 8583978.29    0   55 8990009.34 8583978.29  4.52%     -   75s
     
0     2 8585058.40    0   55 8990009.34 8585058.40  4.50%     -   75s
   
123    28 8966143.82    9   21 8990009.34 8625719.63  4.05%   144   80s
   
318    78 8746547.41    1   43 8990009.34 8725568.28  2.94%   147   85s
   
520   139 8980956.38    7   30 8990009.34 8767027.01  2.48%   160   90s
   
698   182     cutoff    7      8990009.34 8802937.63  2.08%   172   95s


Cutting planes:
 
Gomory: 3
 
Implied bound: 3
  MIR
: 39
 
Flow cover: 29


Observation: print of 'DEBUG: optimized' is not reached -> program seem to crash on gurobis behalf. No more python-code after is executed.

Sorry, that i didn't check this earlier. This first step should have been obvious :-)

---
Sascha

Greg Glockner

unread,
Jan 20, 2015, 11:47:58 AM1/20/15
to gur...@googlegroups.com
Thanks, that's definitely something we should investigate. We will contact you privately.

Reply all
Reply to author
Forward
0 new messages