Skip to content

Commit 23af82f

Browse files
h-g-sCopilot
andcommitted
ClpSimplex::fathomMany: handle unexpected problemStatus_ gracefully
Replace hard assert(problemStatus_ == 0 || problemStatus_ == 1) with a graceful early exit when fastDual2 leaves an unexpected status (e.g. 4, -1, 11 from numerical difficulties). The assert triggered on instance neos-2657525-crna after ~3 hours of B&B (SIGABRT, exit code 134). The fix mirrors the identical pattern already present in fathom() at line 11799, which sets info->nNodes_ = -1 and returns cleanly. The now-unreachable problemStatus_ == 10 abort block is also removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d46585a commit 23af82f

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/ClpSimplex.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12479,10 +12479,16 @@ int ClpSimplex::fathomMany(void *stuff)
1247912479
info->numberIterations_ = numberIterations_;
1248012480
return -1;
1248112481
}
12482-
assert(problemStatus_ == 0 || problemStatus_ == 1); //(static_cast<ClpSimplexDual *> this)->dual(0,0);
12483-
if (problemStatus_ == 10) {
12484-
printf("Cleaning up with primal - need coding without createRim!\n");
12485-
abort();
12482+
if (problemStatus_ != 0 && problemStatus_ != 1) {
12483+
// unexpected status (e.g. numerical difficulties, status 4, -1, etc.) - cannot fathom
12484+
#ifdef COIN_DEVELOP
12485+
printf("bad status %d on initial fast dual in fathomMany\n", problemStatus_);
12486+
#endif
12487+
stopFastDual2(info);
12488+
info->nNodes_ = 0;
12489+
info->numberNodesExplored_ = 0;
12490+
info->numberIterations_ = numberIterations_;
12491+
return -1;
1248612492
}
1248712493
int numberNodes = 0;
1248812494
int numberIterations = numberIterations_;

0 commit comments

Comments
 (0)