[Clp] Objective value is nan, or checkClear assertion failure from createRim

Aleksandr M. Kazachkov akazachk at cmu.edu
Wed Aug 9 12:50:08 EDT 2017


Hi everyone,

I have intermittently run into the following problems with LPs that I am
solving. I can reproduce the first three errors and attach LPs and sample
code below this message that works to reproduce the issues on my machine
(error 2 only happens with "badLP1"). The fourth error is consistently
produced with my full code, but the sample code does not generate it.

(1) Occasionally the objective value ends up being nan with an accompanying
assertion failure "OsiClpSolverInterface.cpp:1203: virtual void
OsiClpSolverInterface::resolve(): Assertion
`modelPtr_->objectiveValue()<1.0e100' failed." (This may be related to the
issue I wrote about, and was resolved, in May:
https://list.coin-or.org/pipermail/clp/2017-May/001705.html.)

(2) When I try to avoid the problem by using an initialSolve after checking
whether resolve yields a nan objective, Clp may run into a segmentation
fault in gutsOfDelete at ClpSimplex.cpp:2755 when deleting rowCopy_. Before
the seg-fault, I see the status message Clp0006I 13  Obj -nan Primal inf
inf (103).

(3) If presolve is turned on for resolve, an error I get is
ClpSimplexDual.cpp:7959: void ClpSimplexDual::resetFakeBounds(int):
Assertion `!nErrors' failed, again with a preceding status of Clp0006I 3
 Obj -nan Primal inf inf (6).

(4) Sometimes I run into an assertion failure in createRim, at
ClpSimplex.cpp:4186, when calling checkClear for rowArray_[0]. This is
always after the problem gets perturbed by ClpSimplexDual::perturb. This
may or may not be related to a previous email from 2005:
https://list.coin-or.org/pipermail/clp/2005-August/000327.html, which was
seemingly resolved by adding a "clear" in the relevant block of the code.
However, what I see (when clear is run) is that one element of the
CoinIndexedVector, rowArray_[0], is non-zero (at an extremely large
number), while nElements_ is 0, so the block of code starting at
CoinIndexedVector.cpp:47 is not entered into.

I am using Clp version 1.16 build Jun 17 2017 on a Fedora machine. The
compilation options are: enable_debug=yes, enable_gnu_packages=yes, with
blas and lapack.

The LP is resolved many times with different objective functions. There are
many free variables in the LP, which I think may be relevant. The LP is
also probably numerically unstable (e.g., in badLP1, the smallest
coefficient is 1e-6 and the largest is 80640, and badLP2 is worse). I set a
time limit of five seconds for each solve (which may or may not be
relevant).

Please let me know if I can provide any more information,
Alex

=== Errors ===
// Set generateError1 to false if you want to see error 2
const bool generateError1 = true; // must be false to get error 2
const bool generateError2 = true;
const bool generateError3 = false;  // must be false to get error 1 or
error 2
const int num_iters = 1000;
int iter = 0;

if (generateError3) {
  solver->setHintParam(OsiDoPresolveInResolve, 1);
}
solver->getModelPtr()->setMaximumSeconds(5);
solver->initialSolve();
while (iter < num_iters) {
    for (int i = 0; i < solver->getNumCols(); i++) {
      solver->getModelPtr()->setMaximumSeconds(5);
      solver->setObjCoeff(i, 1.);
      solver->resolve();
      if (!generateError1 && std::isnan(solver->getObjValue())) {
        solver->getModelPtr()->setMaximumSeconds(5);
        solver->initialSolve();
        if (generateError2 && solver->isProvenOptimal()) {
          solver->resolve();
        }
      } else if (generateError1) {
        solver->resolve();
      }
      solver->setObjCoeff(i, 0.);
    }
    iter++;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20170809/a863fc83/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: badLP1.mps.gz
Type: application/x-gzip
Size: 6192 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/clp/attachments/20170809/a863fc83/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: badLP2.mps.gz
Type: application/x-gzip
Size: 10995 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/clp/attachments/20170809/a863fc83/attachment-0003.bin>


More information about the Clp mailing list