coin-or / SHOT

A solver for mixed-integer nonlinear optimization problems
https://shotsolver.dev
Eclipse Public License 2.0
119 stars 26 forks source link

SHOT crashes with Termination.TimeLimit #95

Open veskur opened 4 years ago

veskur commented 4 years ago

We are using SHOT for a MIQCQP on Linux (Debian). Sometimes, but not always, SHOT crashes with Segmentation fault (core dumped) when using the time limit flag Termination.TimeLimit (see below). Nevertheless, running SHOT again with exactly the same configuration may or may not succeed. One the other hand, after removing the Termination.TimeLimit, SHOT has run perfectly fine for now. Interestingly, the time limit is apparently not considered, meaning that a limit of e.g. 2 seconds has long been exceeded when SHOT crashes.

Call: SHOT 160139061642117510802438150482602.osil Model.BoundTightening.FeasibilityBased.TimeLimit=0 Termination.TimeLimit=2 Dual.MIP.Solver=2 --osrl 160121502130516382784313271567890.osrl --log shot.log

╶ Supporting Hyperplane Optimization Toolkit (SHOT) ──────────────────────────────────────────────────────────────────╴

 Andreas Lundell and Jan Kronqvist, Åbo Akademi University, Finland.
 See documentation for full list of contributors and utilized software libraries.

 Version: 1.0.1. Git hash: 9306c402. Released: Jul  1 2020.

 For more information visit https://shotsolver.dev

╶ Modeling system ────────────────────────────────────────────────────────────────────────────────────────────────────╴

 Modeling system:            OSiL
 Problem read from file:     160139061642117510802438150482602.osil

 Performing bound tightening on original problem.
  - Bounds for 0 variables tightened in 0.00 s.
 Performing bound tightening on reformulated problem.
  - Bounds for 0 variables tightened in 0.00 s.

╶ Problem instance ───────────────────────────────────────────────────────────────────────────────────────────────────╴

                                    Original             Reformulated

 Problem classification:            MIQCQP, nonconvex    MINLP, nonconvex

 Objective function direction:      maximize             maximize
 Objective function type:           linear               linear

 Number of constraints:             845                  845
  - linear:                         844                  844
  - nonconvex quadratic:            1                    0
  - nonconvex nonlinear:            0                    1

 Number of variables:               452                  452
  - real:                           226                  226
  - binary:                         226                  226
  - nonlinear:                      226                  226

╶ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╴

 No options file specified.

 Nondefault options used:

  - Dual.ESH.InteriorPoint.CuttingPlane.IterationLimit = 50
  - Dual.HyperplaneCuts.ConstraintSelectionFactor = 1.0
  - Dual.HyperplaneCuts.UseIntegerCuts = true
  - Dual.MIP.Presolve.UpdateObtainedBounds = false
  - Dual.MIP.SolutionLimit.Initial = 2147483647
  - Dual.MIP.Solver = 2
  - Dual.Relaxation.Use = false
  - Dual.TreeStrategy = 0
  - Model.BoundTightening.FeasibilityBased.TimeLimit = 5.0
  - Model.Reformulation.Constraint.PartitionNonlinearTerms = 1
  - Model.Reformulation.Constraint.PartitionQuadraticTerms = 0
  - Model.Reformulation.ObjectiveFunction.PartitionNonlinearTerms = 1
  - Model.Reformulation.ObjectiveFunction.PartitionQuadraticTerms = 0
  - Model.Reformulation.Quadratics.Strategy = 0
  - Primal.FixedInteger.CallStrategy = 0
  - Primal.FixedInteger.OnlyUniqueIntegerCombinations = false
  - Primal.FixedInteger.Source = 0
  - Primal.Tolerance.TrustLinearConstraintValues = false
  - Termination.TimeLimit = 2.0

 Dual strategy:              Multi-tree
  - cut algorithm:           ESH
  - solver:                  Cbc 2.10.4

 Primal NLP solver:          Ipopt 3.13.3 (with default linear solver)

╶ Interior point search ──────────────────────────────────────────────────────────────────────────────────────────────╴

 Strategy selected:          cutting plane minimax

    Iteration     │  Time  │    Cuts     │     Objective value     │  Objective diff.
     #: type      │  tot.  │   + | tot.  │    problem | line srch  │    abs. | rel.
╶─────────────────┴────────┴─────────────┴─────────────────────────┴──────────────────╴
     1: LP           0.14                      -1e+12 | -1e+12          inf. | inf.
     2: LP           0.17      1 | 1      -0.00748551 | -0.00228258  5.2e-03 | 7.0e-01

 Valid interior point with constraint deviation -0.002 found.

    Iteration     │  Time  │  Dual cuts  │     Objective value     │   Objective gap   │     Current solution
     #: type      │  tot.  │   + | tot.  │     primal | dual       │    abs. | rel.    │    obj.fn. | max.err.)
╶─────────────────┴────────┴─────────────┴─────────────────────────┴───────────────────┴───────────────────────────╴)

     1: MILP-O       0.20                       -inf. | -0.703175       inf. | 1.0e+00    -0.703175 | 0: 4.80e-04
     1: NLPNEWDB-O   1.38                       -inf. | -0.703175       inf. | 1.0e+00              | inf.
        Solution is no longer global since integer cut has been added.
     2: MILP-O       1.44      2 | 2            -inf. |*-0.705359       inf. | 1.0e+00    -0.705359 | 0: 1.73e-05
     2: NLPNEWDB-O   2.12      2 | 2         -1.22593 |*-0.705359    5.2e-01 | 4.3e-01     -1.22593 | 0: -1.70e-03
     3: MILP-TL      2.16      5 | 7        -0.705445 |*-0.705359    8.6e-05 | 1.2e-04    -0.705445 | 0: 3.38e-08
     1: REDCUT-1     2.79   Obj.cut: -0.704739                                                                          
        Forced optimal iteration since difference between MIP solution and primal is small
     4: MILP-I       2.81                   -0.705445 |*inf.            inf. | inf.                 | inf.
     1: REP-SUCC     2.82   Repairs: 5
     5: MILP-I       2.84      2 | 9        -0.705445 |*inf.            inf. | inf.                 | inf.
     2: REP-SUCC     2.86   Repairs: 2
Segmentation fault (core dumped)
andreaslundell commented 4 years ago

Could you try to run with a higher level of logging, e.g. Output.Console.LogLevel=1 or Output.Console.LogLevel=0 (if you want to save it to a file, as it seems you do, use Output.File.LogLevel instead). Also add Output.Console.DualSolver.Show=true to get the output of Cbc in the log file.

And then attach the log file to this issue or send it to me at andreas.lundell@abo.fi? Also if you would be willing to share the problem file, it would make finding the error easier...

Could you also try to only use one thread with Cbc, i.e, --threads=1, and see if that helps?

The cause of the issue may be Cbc (c.f. https://github.com/coin-or/SHOT/issues/85), which has some stability issues I have not been able to pinpoint... However, that does not explain the missing time-limit, which seems like a bug in either Cbc or SHOT to me.

veskur commented 4 years ago

Thank you for your fast feedback. I added our debug flags and tried the suggested solution but sadly with no success. Attached you find the output files, the first three with core dumps at different times during the computation and the last is one randomly successful run. I will also send you the problem file to the given address.

core_dumped_1.txt core_dumped_2.txt core_dumped_3.txt

success.txt