Gurobi.jl icon indicating copy to clipboard operation
Gurobi.jl copied to clipboard

How to settle down the "auto-reset" of programming-code using Gurobi.jl

Open YuanYiping123456 opened this issue 3 years ago • 14 comments

Hello,

I am attempting to calculate the optimal result of a mixed integer linearized programming (MILP) using JuMP/Gurobi packages. My source code is a classical unit commitment, which is also a mathematical MILP problem.

Some code snippets list below:

scuc = JuMP.Model(Gurobi.Optimizer)
set_optimizer_attribute(scuc, "MIPGap", 0.002)
set_optimizer_attribute(scuc, "IterationLimit", 100)

balabalabala  # this is a MILP problem including 600 lines
JuMP.optimize!(scuc)

println("callback gurobisolver\t\t\t\t\t\t\t done")
@test JuMP.termination_status(scuc) == MOI.OPTIMAL
@test JuMP.primal_status(scuc) == MOI.FEASIBLE_POINT

When I run this code, I get the following error:

Set parameter Username
Academic license - for non-commercial use only - expires 2023-04-07
Set parameter MIPGap to value 0.002
start...

objective_function
     MILP_type objective_function                            done
subject to.
     constraints: 1) minimum shutup/shutdown time limits     done
     constraints: 2) binary variable logic                   done
     constraints: 3) shutup/shutdown cost                    done
     constraints: 4) loadcurtailments and spoliedwinds       done
     constraints: 5) generatos power limits                  done
     constraints: 6) system reserves limits                  done
     constraints: 7) power balance constraints               done
     constraints: 8) ramp-up/ramp-down constraints           done
     constraints: 9) piece linearization constraints         done


Model has been loaded
Step-4: calculation...
Set parameter MIPGap to value 0.002
Gurobi Optimizer version 9.5.1 build v9.5.1rc2 (linux64)
Thread count: 36 physical cores, 72 logical processors, using up to 32 threads
Optimize a model with 1861700 rows, 1271520 columns and 57974450 nonzeros
Model fingerprint: 0xf2ca8ff2
Variable types: 1252080 continuous, 19440 integer (19440 binary)
Coefficient statistics:
  Matrix range     [3e-02, 4e+02]
  Objective range  [4e-01, 2e+06]
  Bounds range     [0e+00, 0e+00]
  RHS range        [6e-02, 4e+02]
Presolve removed 19410 rows and 12690 columns (presolve time = 5s) ...
Presolve removed 100230 rows and 12690 columns (presolve time = 11s) ...
Presolve removed 100230 rows and 12960 columns (presolve time = 17s) ...
Presolve removed 100230 rows and 12960 columns (presolve time = 21s) ...
Presolve removed 100230 rows and 12960 columns (presolve time = 29s) ...
Presolve removed 100230 rows and 12960 columns (presolve time = 32s) ...
Presolve removed 293910 rows and 84240 columns (presolve time = 36s) ...
Presolve removed 293910 rows and 84240 columns (presolve time = 42s) ...
Presolve removed 293910 rows and 84240 columns (presolve time = 46s) ...
Presolve removed 294030 rows and 84745 columns (presolve time = 50s) ...
Presolve removed 303910 rows and 85145 columns (presolve time = 55s) ...
Presolve removed 304575 rows and 85325 columns (presolve time = 60s) ...
Presolve removed 305025 rows and 85375 columns (presolve time = 68s) ...
Presolve removed 305025 rows and 86155 columns (presolve time = 70s) ...
Presolve removed 308635 rows and 94225 columns (presolve time = 75s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 80s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 86s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 90s) ...
Presolve removed 310785 rows and 94555 columns (presolve time = 95s) ...
Presolve removed 312113 rows and 94555 columns (presolve time = 100s) ...
Presolve removed 312113 rows and 94555 columns (presolve time = 105s) ...
Presolve removed 312113 rows and 94555 columns
Presolve time: 106.95s
Presolved: 1549587 rows, 1176965 columns, 6653655 nonzeros
Variable types: 1159200 continuous, 17765 integer (17765 binary)

Deterministic concurrent LP optimizer: primal simplex, dual simplex, and barrier
Showing barrier log only...

Root barrier log...

Elapsed ordering time = 7s

Julia has exited.
Press Enter to start a new session.

I am not sure if my code is incorrect or if there is a potential bug here. Anyone helps me would be much appreciated.

YuanYiping123456 avatar May 21 '22 03:05 YuanYiping123456

To clarify, does

Julia has exited. Press Enter to start a new session.

mean that Julia quit? Is there anything else that gets printed?

If so, that looks like a bug in Gurobi!

We can diagnose things going wrong if you print out the MPS file. Change these two lines:

# scuc = JuMP.Model(Gurobi.Optimizer)
scuc = JuMP.direct_model(Gurobi.Optimizer())
# JuMP.optimize!(scuc)
Gurobi.GRBwrite(scuc, "issue_477.mps")

And then upload the MPS file. (You can upload files to Github through the "Attach files by dragging & dropping" dialog at the bottom of the comment field.)

If you get an error about constraints not supported, only change one line:

# JuMP.optimize!(scuc)
JuMP.write_to_file(scuc, "issue477.mps")

odow avatar May 21 '22 03:05 odow

Thank you for your response.

I run my source code in a Atom/JunPro environment. And Julia will be auto-reset and quite after printing this message.

Now, I have being testing these source codes after modifying several input parameters. So, I may submit the MPS file several minus later. Please wait for me. Big thanks.

Another thing I thought might be interesting. When I corrected some input parameters for reducing the UC model complexity, this message is disappeared and the error is gone. From this point, it may not be a problem with my source code itself.

The below lists another successful information for my new case after corrected input boundary.

Set parameter Username
Academic license - for non-commercial use only - expires 2023-04-07
Set parameter MIPGap to value 0.02
start...
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
objective_function
     MILP_type objective_function                            done
subject to.
     constraints: 1) minimum shutup/shutdown time limits     done
     constraints: 2) binary variable logic                   done
┌ Warning: Axis contains one element: 1. If intended, you can safely ignore this warning. To explicitly pass the axis with one element, pass `[1]` instead of `1`.
└ @ JuMP.Containers ~/.julia/packages/JuMP/0C6kd/src/Containers/DenseAxisArray.jl:166
┌ Warning: Axis contains one element: 1. If intended, you can safely ignore this warning. To explicitly pass the axis with one element, pass `[1]` instead of `1`.
└ @ JuMP.Containers ~/.julia/packages/JuMP/0C6kd/src/Containers/DenseAxisArray.jl:166
     constraints: 3) shutup/shutdown cost                    done
     constraints: 4) loadcurtailments and spoliedwinds       done
     constraints: 5) generatos power limits                  done
     constraints: 6) system reserves limits                  done
     constraints: 7) hidden flexbility                       done
     constraints: 8) power balance constraints               done
     constraints: 9) ramp-up/ramp-down constraints           done
     constraints: 10) piece linearization constraints        done


Model has been loaded
Step-4: calculation...
Set parameter MIPGap to value 0.02
Gurobi Optimizer version 9.5.1 build v9.5.1rc2 (linux64)
Thread count: 36 physical cores, 72 logical processors, using up to 32 threads
Optimize a model with 559376 rows, 448080 columns and 1797299 nonzeros
Model fingerprint: 0x7fd4c5a9
Variable types: 440880 continuous, 7200 integer (6480 binary)
Coefficient statistics:
  Matrix range     [3e-02, 4e+02]
  Objective range  [4e-01, 2e+06]
  Bounds range     [0e+00, 0e+00]
  RHS range        [6e-02, 4e+02]
Presolve removed 82789 rows and 52235 columns (presolve time = 5s) ...
Presolve removed 102666 rows and 52886 columns (presolve time = 37s) ...
Presolve removed 210809 rows and 156403 columns (presolve time = 45s) ...
Presolve removed 210809 rows and 156403 columns (presolve time = 45s) ...
Presolve removed 210839 rows and 156404 columns
Presolve time: 47.25s
Presolved: 348537 rows, 291676 columns, 1152693 nonzeros
Variable types: 286840 continuous, 4836 integer (4508 binary)

Deterministic concurrent LP optimizer: primal and dual simplex
Showing first log only...


Root simplex log...

Iteration    Objective       Primal Inf.    Dual Inf.      Time
       0    3.0462200e+10   3.980513e+00   2.857066e+09     51s
   39359    1.0323864e+11   0.000000e+00   1.347848e+11     51s
  144153    3.8065407e+10   0.000000e+00   1.245023e+12     55s
  193617    3.7185028e+10   0.000000e+00   2.503942e+13     60s
  208057    3.6270555e+10   0.000000e+00   1.635002e+12     65s
  219076    3.6058880e+10   0.000000e+00   1.275159e+13     70s
  230995    3.5532924e+10   0.000000e+00   5.772214e+12     75s
  241599    3.5039462e+10   0.000000e+00   2.488863e+12     80s
  251958    3.4653348e+10   0.000000e+00   1.863989e+12     85s
  258421    3.4205817e+10   0.000000e+00   1.720968e+12     90s
  270117    3.3534444e+10   0.000000e+00   1.241077e+13     95s
  285159    3.3027940e+10   0.000000e+00   1.879681e+13    100s
  292118    3.1911418e+10   0.000000e+00   3.372964e+12    105s
  300674    3.1281612e+10   0.000000e+00   1.840619e+12    110s
  307697    3.1072317e+10   0.000000e+00   1.892933e+12    115s
  312816    3.0813234e+10   0.000000e+00   4.462104e+14    120s
  323027    3.0622645e+10   0.000000e+00   2.892969e+13    125s
  328238    2.9283110e+10   0.000000e+00   4.872103e+14    130s
  332968    2.8813960e+10   0.000000e+00   7.943459e+12    135s
Concurrent spin time: 14.58s

Solved with dual simplex

Root relaxation: objective 1.926049e+09, 196599 iterations, 89.45 seconds (109.62 work units)
Total elapsed time = 140.25s

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

     0     0 1.9260e+09    0  852          - 1.9260e+09      -     -  181s
H    0     0                    1.926551e+09 1.9260e+09  0.03%     -  183s

Explored 1 nodes (197456 simplex iterations) in 183.53 seconds (153.99 work units)
Thread count was 32 (of 72 available processors)

Solution count 1: 1.92655e+09 

Optimal solution found (tolerance 2.00e-02)
Best objective 1.926551391554e+09, best bound 1.926049488311e+09, gap 0.0261%

User-callback calls 40009, time in user-callback 0.05 sec
callback gurobisolver                            done
#TEST: termination_status                        pass
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3.1806715919758853e7
the calculation_result has been saved into | calculation_result.txt |    done
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

YuanYiping123456 avatar May 21 '22 04:05 YuanYiping123456

Hi, GitHub seems to have a file size limitation of uploaded files.

So, I have to export and sent the "issue 447.mps" file to you through Google Drive. Please check that. Thank you very much.


Snipaste_2022-05-21_13-43-47

YuanYiping123456 avatar May 21 '22 05:05 YuanYiping123456

Oh wow pretty big!

Can you try calling Gurobi from the cmd prompt?

gurobi_cl issue477.mps

Can you post the link to the Google Drive file?

odow avatar May 21 '22 05:05 odow

No Problem. Please check this link: https://drive.google.com/file/d/1ttQTnIYJfmn6O7tU_NjwWjSalSVB7fSs/view?usp=sharing. And I have also run "gurobi_cl issue477.mps" as you suggested.

The below shows the prompt. Snipaste_2022-05-21_13-56-41

YuanYiping123456 avatar May 21 '22 05:05 YuanYiping123456

Is that for the big original problem that crashes Julia? Hmm. It's going to be hard to find the problem if we can't reproduce via gurobi_cl. How much memory do you have on the machine?

odow avatar May 21 '22 06:05 odow

Yes. I am trying to test my code through actual cases. Therefore, the size of model structure is a bit large. I run my code in a Linux-based Ubuntu server. The memory is about 125 GB.

Snipaste_2022-05-21_14-03-23

YuanYiping123456 avatar May 21 '22 06:05 YuanYiping123456

Great! "gurobi_cl" work well.

I run "gurobi_cl issue477.mps" on my person PC desktop, and successfully calculate the optimal result. I'm curious about this issue. Why "JuMP.optimize!(scuc)" does not work, but "gurobi_cl" does.

PS D:\New folder> gurobi_cl issue477.mps
Set parameter Username
Set parameter LogFile to value "gurobi.log"
Academic license - for non-commercial use only - expires 2023-04-02
Using license file C:\Users\YipingYUAN\gurobi.lic

Gurobi Optimizer version 9.5.1 build v9.5.1rc2 (win64)
Copyright (c) 2022, Gurobi Optimization, LLC

Read MPS format model from file issue477.mps
Reading time = 41.49 seconds
: 1861700 rows, 1271520 columns, 57974450 nonzeros
Thread count: 6 physical cores, 12 logical processors, using up to 12 threads
Optimize a model with 1861700 rows, 1271520 columns and 57974450 nonzeros
Model fingerprint: 0xfe150f41
Variable types: 1252080 continuous, 19440 integer (19440 binary)
Coefficient statistics:
  Matrix range     [3e-02, 4e+02]
  Objective range  [4e-01, 2e+06]
  Bounds range     [1e+00, 1e+00]
  RHS range        [6e-02, 4e+02]
Presolve removed 100230 rows and 12690 columns (presolve time = 5s) ...
Presolve removed 100230 rows and 12960 columns (presolve time = 11s) ...
Presolve removed 293910 rows and 84240 columns (presolve time = 15s) ...
Presolve removed 294030 rows and 84630 columns (presolve time = 20s) ...
Presolve removed 303910 rows and 85145 columns (presolve time = 25s) ...
Presolve removed 303910 rows and 85145 columns (presolve time = 30s) ...
Presolve removed 304575 rows and 85325 columns (presolve time = 35s) ...
Presolve removed 305025 rows and 86155 columns (presolve time = 42s) ...
Presolve removed 308635 rows and 94225 columns (presolve time = 45s) ...
Presolve removed 310465 rows and 94255 columns (presolve time = 50s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 56s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 61s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 65s) ...
Presolve removed 312240 rows and 94555 columns (presolve time = 70s) ...
Presolve removed 312240 rows and 94555 columns (presolve time = 75s) ...
Presolve removed 312240 rows and 94555 columns
Presolve time: 77.01s
Presolved: 1549460 rows, 1176965 columns, 6259850 nonzeros
Variable types: 1159200 continuous, 17765 integer (17765 binary)

Deterministic concurrent LP optimizer: primal simplex, dual simplex, and barrier
Showing barrier log only...

Root barrier log...

Ordering time: 3.31s

Barrier statistics:
 Dense cols : 1433
 AA' NZ     : 5.678e+06
 Factor NZ  : 4.914e+07 (roughly 600 MB of memory)
 Factor Ops : 5.764e+10 (roughly 1 second per iteration)
 Threads    : 3

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0  -3.34544413e+12 -5.89446833e+12  1.64e+03 7.64e+08  2.69e+09   107s
   1  -2.84771993e+12 -6.38234443e+12  1.20e+03 4.55e+08  1.92e+09   108s
   2  -1.94522095e+12 -7.62174646e+12  7.56e+02 1.01e+08  1.18e+09   109s
   3  -7.19606302e+11 -7.99508070e+12  2.87e+02 4.09e+06  4.70e+08   110s
   4  -5.07994690e+10 -6.64884375e+12  3.50e+01 2.15e+04  6.32e+07   111s
   5   6.18493756e+09 -4.25346850e+12  1.46e+01 1.31e+03  2.54e+07   113s
   6   3.14815192e+10 -2.55563044e+12  7.20e+00 2.20e+02  1.15e+07   115s
   7   4.18017949e+10 -1.51462495e+12  4.47e+00 6.45e+01  6.05e+06   116s
   8   4.34925852e+10 -1.08873215e+12  3.27e+00 3.61e+01  3.99e+06   118s
   9   4.18602814e+10 -8.39104307e+11  2.28e+00 2.39e+01  2.73e+06   119s
  10   3.67468169e+10 -5.68907713e+11  1.57e+00 1.32e+01  1.70e+06   120s
  11   2.96258312e+10 -3.32230032e+11  1.06e+00 5.57e+00  9.52e+05   122s
  12   1.94947395e+10 -1.74835351e+11  6.17e-01 2.21e+00  4.67e+05   124s
  13   1.77579592e+10 -1.16874299e+11  4.25e-01 1.28e+00  3.03e+05   125s
  14   1.40744586e+10 -7.41560173e+10  2.75e-01 7.27e-01  1.86e+05   127s
  15   1.10957831e+10 -2.48885522e+10  1.75e-01 1.89e-01  7.60e+04   130s
  16   1.04491781e+10 -1.19107065e+10  1.53e-01 1.46e-01  4.79e+04   132s
  17   7.10684637e+09 -2.92472567e+09  4.17e-02 5.87e-02  1.85e+04   133s
  18   6.67974447e+09 -2.20196144e+09  3.08e-02 5.31e-02  1.59e+04   135s
  19   6.47759578e+09  2.34115567e+09  2.53e-02 2.07e-02  7.72e+03   136s
  20   5.91352316e+09  4.55124474e+09  6.63e-03 5.43e-03  2.41e+03   138s
  21   5.83704336e+09  5.36088327e+09  3.33e-03 1.55e-03  8.93e+02   140s

Barrier performed 21 iterations in 140.57 seconds (174.40 work units)
Barrier solve interrupted - model solved by another algorithm

Concurrent spin time: 3.74s

Solved with dual simplex

Root relaxation: objective 5.783519e+09, 154691 iterations, 50.87 seconds (27.02 work units)
Total elapsed time = 153.76s
Total elapsed time = 160.21s
Total elapsed time = 165.28s

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

     0     0 5.7835e+09    0 1099          - 5.7835e+09      -     -  193s
H    0     0                    5.790956e+09 5.7835e+09  0.13%     -  208s
H    0     0                    5.787176e+09 5.7835e+09  0.06%     -  225s
     0     0 5.7837e+09    0  339 5.7872e+09 5.7837e+09  0.06%     -  365s
     0     0 5.7837e+09    0   91 5.7872e+09 5.7837e+09  0.06%     -  442s
     0     0 5.7837e+09    0  278 5.7872e+09 5.7837e+09  0.06%     - 1037s
     0     0 5.7837e+09    0  139 5.7872e+09 5.7837e+09  0.06%     - 1089s
     0     0 5.7837e+09    0   93 5.7872e+09 5.7837e+09  0.06%     - 1132s
     0     0 5.7837e+09    0   93 5.7872e+09 5.7837e+09  0.06%     - 1135s
     0     0 5.7837e+09    0  106 5.7872e+09 5.7837e+09  0.06%     - 1169s
     0     0 5.7837e+09    0  103 5.7872e+09 5.7837e+09  0.06%     - 1181s
     0     0 5.7837e+09    0   73 5.7872e+09 5.7837e+09  0.06%     - 1230s
     0     0 5.7837e+09    0   63 5.7872e+09 5.7837e+09  0.06%     - 1251s
     0     0 5.7837e+09    0   74 5.7872e+09 5.7837e+09  0.06%     - 1277s
     0     0 5.7837e+09    0   78 5.7872e+09 5.7837e+09  0.06%     - 1291s
     0     0 5.7837e+09    0   79 5.7872e+09 5.7837e+09  0.06%     - 1307s
     0     0 5.7837e+09    0   72 5.7872e+09 5.7837e+09  0.06%     - 1322s
     0     0 5.7837e+09    0   84 5.7872e+09 5.7837e+09  0.06%     - 1334s
     0     0 5.7837e+09    0   62 5.7872e+09 5.7837e+09  0.06%     - 1367s
     0     0 5.7837e+09    0   60 5.7872e+09 5.7837e+09  0.06%     - 1382s
     0     0 5.7837e+09    0   58 5.7872e+09 5.7837e+09  0.06%     - 1400s
     0     0 5.7837e+09    0   58 5.7872e+09 5.7837e+09  0.06%     - 1435s
H    0     0                    5.783749e+09 5.7837e+09  0.00%     - 1459s

Cutting planes:
  Gomory: 57
  Implied bound: 9969
  MIR: 6186
  Flow cover: 2475
  RLT: 137
  Relax-and-lift: 2733

Explored 1 nodes (1170103 simplex iterations) in 1460.45 seconds (1045.78 work units)
Thread count was 12 (of 12 available processors)

Solution count 3: 5.78375e+09 5.78718e+09 5.79096e+09

Optimal solution found (tolerance 1.00e-04)
Best objective 5.783748865417e+09, best bound 5.783727145098e+09, gap 0.0004%
PS D:\New folder>

YuanYiping123456 avatar May 21 '22 07:05 YuanYiping123456

Why "JuMP.optimize!(scuc)" does not work, but "gurobi_cl" does.

I don't know. That's the problem!

Can you try with all of your options that you had set?

gurobi_cl MIPGap=0.002 IterationLimit=100 issue477.mps

odow avatar May 22 '22 00:05 odow

Of course.

The below shows the calculating process.

PS D:\gurobi_test> gurobi_cl MIPGap=0.002 IterationLimit=100 issue477.mps
Set parameter Username
Set parameter IterationLimit to value 100
Set parameter MIPGap to value 0.002
Set parameter LogFile to value "gurobi.log"
Academic license - for non-commercial use only - expires 2023-04-02
Using license file C:\Users\YipingYUAN\gurobi.lic

Gurobi Optimizer version 9.5.1 build v9.5.1rc2 (win64)
Copyright (c) 2022, Gurobi Optimization, LLC

Read MPS format model from file issue477.mps
Reading time = 40.75 seconds
: 1861700 rows, 1271520 columns, 57974450 nonzeros
Thread count: 6 physical cores, 12 logical processors, using up to 12 threads
Optimize a model with 1861700 rows, 1271520 columns and 57974450 nonzeros
Model fingerprint: 0xfe150f41
Variable types: 1252080 continuous, 19440 integer (19440 binary)
Coefficient statistics:
  Matrix range     [3e-02, 4e+02]
  Objective range  [4e-01, 2e+06]
  Bounds range     [1e+00, 1e+00]
  RHS range        [6e-02, 4e+02]
Presolve removed 100230 rows and 12690 columns (presolve time = 5s) ...
Presolve removed 100230 rows and 12960 columns (presolve time = 11s) ...
Presolve removed 293910 rows and 84240 columns (presolve time = 15s) ...
Presolve removed 294030 rows and 84630 columns (presolve time = 20s) ...
Presolve removed 294030 rows and 84745 columns (presolve time = 25s) ...
Presolve removed 303910 rows and 85145 columns (presolve time = 30s) ...
Presolve removed 304575 rows and 85325 columns (presolve time = 35s) ...
Presolve removed 305025 rows and 85375 columns (presolve time = 42s) ...
Presolve removed 305025 rows and 86155 columns (presolve time = 45s) ...
Presolve removed 308635 rows and 94225 columns (presolve time = 50s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 55s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 61s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 66s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 70s) ...
Presolve removed 312240 rows and 94555 columns (presolve time = 75s) ...
Presolve removed 312240 rows and 94555 columns (presolve time = 80s) ...
Presolve removed 312240 rows and 94555 columns
Presolve time: 83.77s
Presolved: 1549460 rows, 1176965 columns, 6259850 nonzeros
Variable types: 1159200 continuous, 17765 integer (17765 binary)

Deterministic concurrent LP optimizer: primal simplex, dual simplex, and barrier
Showing barrier log only...



Root relaxation: iteration limit, 100 iterations, 9.76 seconds (3.24 work units)

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

     0     0  postponed    0               - 5.5722e+09      -     -  112s

Explored 1 nodes (100 simplex iterations) in 112.66 seconds (140.79 work units)
Thread count was 12 (of 12 available processors)

Solution count 0

Iteration limit reached
Best objective -, best bound 5.572193738095e+09, gap -
PS D:\gurobi_test>

YuanYiping123456 avatar May 22 '22 05:05 YuanYiping123456

Hmm. Did you use GRBwrite to make the MPS files? The fingerprints are different

Model fingerprint: 0xf2ca8ff2 Model fingerprint: 0xfe150f41

Is there any randomness in how you create the problem?

odow avatar May 22 '22 05:05 odow

Oh....

During my case, there are some randomness input data representing the stochastic realization of uncertain resources.

Last night till now, I used this source code to continue running other cases. But I forget to comment this line “Gurobi.GRBwrite(scuc, "issue_447.mps")”, which generating issue447.mps files. As for this, the source code may overwrite the previous .mps file and regenerate a new issue477.mps file.

I have downloaded the issue447,mps file that I shared yesterday, and ran this command. But I found the model fingerprint is still 0xfe150f41. Please check it below.

Snipaste_2022-05-22_14-28-44

Gurobi 9.5.1 (win64, gurobi_cl) logging started Sun May 22 14:13:36 2022

Set parameter Username
Set parameter IterationLimit to value 100
Set parameter MIPGap to value 0.002
Set parameter LogFile to value "gurobi.log"
Academic license - for non-commercial use only - expires 2023-04-02
Using license file C:\Users\YipingYUAN\gurobi.lic

Gurobi Optimizer version 9.5.1 build v9.5.1rc2 (win64)
Copyright (c) 2022, Gurobi Optimization, LLC

Read MPS format model from file issue477.mps
Reading time = 40.58 seconds
: 1861700 rows, 1271520 columns, 57974450 nonzeros
Thread count: 6 physical cores, 12 logical processors, using up to 12 threads
Optimize a model with 1861700 rows, 1271520 columns and 57974450 nonzeros
Model fingerprint: 0xfe150f41
Variable types: 1252080 continuous, 19440 integer (19440 binary)
Coefficient statistics:
  Matrix range     [3e-02, 4e+02]
  Objective range  [4e-01, 2e+06]
  Bounds range     [1e+00, 1e+00]
  RHS range        [6e-02, 4e+02]
Presolve removed 100230 rows and 12690 columns (presolve time = 5s) ...
Presolve removed 100230 rows and 12960 columns (presolve time = 11s) ...
Presolve removed 293910 rows and 84240 columns (presolve time = 15s) ...
Presolve removed 294030 rows and 84630 columns (presolve time = 20s) ...
Presolve removed 303910 rows and 85145 columns (presolve time = 25s) ...
Presolve removed 303910 rows and 85145 columns (presolve time = 30s) ...
Presolve removed 304725 rows and 85325 columns (presolve time = 35s) ...
Presolve removed 305025 rows and 86155 columns (presolve time = 42s) ...
Presolve removed 308635 rows and 94225 columns (presolve time = 45s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 50s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 55s) ...
Presolve removed 310765 rows and 94555 columns (presolve time = 60s) ...
Presolve removed 312240 rows and 94555 columns (presolve time = 65s) ...
Presolve removed 312240 rows and 94555 columns (presolve time = 70s) ...
Presolve removed 312240 rows and 94555 columns
Presolve time: 74.55s
Presolved: 1549460 rows, 1176965 columns, 6259850 nonzeros
Variable types: 1159200 continuous, 17765 integer (17765 binary)

Deterministic concurrent LP optimizer: primal simplex, dual simplex, and barrier
Showing barrier log only...



Root relaxation: iteration limit, 100 iterations, 7.83 seconds (3.24 work units)

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

     0     0  postponed    0               - 5.5722e+09      -     -   97s

Explored 1 nodes (100 simplex iterations) in 98.16 seconds (140.79 work units)
Thread count was 12 (of 12 available processors)

Solution count 0

Iteration limit reached
Best objective -, best bound 5.572193738095e+09, gap -

Maybe, I should remove any randomness of my input data, and rerun these processes. Is it right ?

YuanYiping123456 avatar May 22 '22 05:05 YuanYiping123456

To be able to debug this, we need an MPS file that can trigger the segfault when run via gurobi_cl.

Of course, if you can reliably trigger that via Gurobi.jl but not via gurobi_cl, then that's also interesting, but a lot harder to debug. If you can reliably trigger via Gurobi.jl, then try

using JuMP, Gurobi
env = Gurobi.Env(; start = false)
GRBsetintparam(env.ptr_env, GRB_INT_PAR_RECORD, 1)
GRBstartenv(env.ptr_env)
model = Model(() -> Gurobi.Optimizer(env))

You'll have to be on the latest release of Gurobi.jl for this to work: https://github.com/jump-dev/Gurobi.jl/releases/tag/v0.11.2

"GRB_INT_PAR_RECORD" is https://www.gurobi.com/documentation/9.5/refman/record.html#parameter:Record

odow avatar May 22 '22 09:05 odow

OK, I will try that, and feedback to you ASAP. Thanks for your help. Please wait, I am very busy these days. I will upload these files in the next days.

..., I will upload related code and continue finding this prob. in the next days. Thanks for waiting.

YuanYiping123456 avatar May 22 '22 09:05 YuanYiping123456

Closing as stale and non-reproducible, and because this doesn't appear to be a bug in Gurobi.jl.

If you can reproduce this from the gurobi_cl, please contact Gurobi support and they'll be able to help you.

odow avatar Nov 10 '22 20:11 odow