HPresolveAnalysis.cpp:103: void HPresolveAnalysis::startPresolveRuleLog(const HighsInt): Assertion `num_deleted_rows0_ == *numDeletedRows' failed
Building
- SCIP from branch https://github.com/scipopt/scip/tree/lpi-highs
- with the latest branch of HiGHS (debug build)
and running the unit test
ctest -R glbconssin SCIP yields the above assert. When I turn on debug_print I get:
...
[lp.c:10346] debug: solving LP 160 (43 cols, 56 rows) with primal simplex (diving=0, nprimallps=15, ndivinglps=0)
Presolving model
startPresolveRuleLog [ 0, 0] for ( 2) Redundant row
startPresolveRuleLog [ 1, 0] for ( 2) Redundant row
startPresolveRuleLog [ 2, 0] for ( 5) Dominated col
startPresolveRuleLog [ 2, 1] for ( 5) Dominated col
startPresolveRuleLog [ 2, 2] for ( 5) Dominated col
startPresolveRuleLog [ 2, 3] for ( 5) Dominated col
startPresolveRuleLog [ 2, 4] for ( 5) Dominated col
startPresolveRuleLog [ 2, 5] for ( 7) Forcing col
53 rows, 37 cols, 135 nonzeros
startPresolveRuleLog [ 3, 6] for ( 2) Redundant row
startPresolveRuleLog [ 4, 6] for ( 2) Redundant row
startPresolveRuleLog [ 5, 6] for ( 7) Forcing col
startPresolveRuleLog [ 6, 7] for ( 7) Forcing col
startPresolveRuleLog [ 7, 8] for ( 7) Forcing col
startPresolveRuleLog [ 8, 9] for ( 7) Forcing col
startPresolveRuleLog [ 11, 11] for (12) Aggregator
ERROR: Model : 9 = num_deleted_rows0_ != *numDeletedRows = 11 ||10 = num_deleted_cols0_ != *numDeletedCols = 11
boxfort-worker: /home/bzfgleix/research/HiGHS/src/presolve/HPresolveAnalysis.cpp:103: void HPresolveAnalysis::startPresolveRuleLog(const HighsInt): Assertion `num_deleted_rows0_ == *numDeletedRows' failed.
Any idea why this is happening? It sounds a bit like a logging error, not an actual incorrect reduction.
It's a logging error
Okay, but can we reopen this and fix it? It would be good to reach a clean run where HiGHS does not throw any asserts.
I think that the problem is because it's a MIP. I wasn't expecting users to turn on debug_print, but I can force the presolve logging to be off for MIPs. It's been useful for some student studies on presolve for LPs
It is not a MIP, the problem is a pure LP. We don't pass any integer information to HiGHS.
And the assert also fails without debug_print, I only turned it on to give you more information.
It is not a MIP, the problem is a pure LP. We don't pass any integer information to HiGHS.
Sorry, of course
It shouldn't be doing the presolve logging by default.
So, presolve_rule_logging is now off by default (in fix-1124 - soon to be in latest)
Since presolve_rule_logging used to be on by default, I'm surprised this assert wasn't triggered for us. This suggests that it's something to do with free rows - since we never have them in MIP subproblems, and they are removed when reading from an MPS file.
Fix now in latest
Thanks a lot! I can confirm that the problem disappears with latest latest.
I tried ctest -R glbconss, but No tests were found!!!
How is this unit test run?
This is the right command, you have to execute it in your build folder, not in the main SCIP folder. Does that resolve the problem?
I didn't have a build folder.
I've just created one off /home/jajhall/scip (where I had been running cmake and make) and ran
cmake .. -DPAPILO=off -DLPS=highs -DHIGHS_DIR=/home/jajhall/HiGHS/build -DCMAKE_BUILD_TYPE=Debug -DREADLINE=off -DGMP=off -DZIMPL=off -DIPOPT=off
but nothing is created, and I see Build files have been written to: /home/jajhall/scip
In /home/jajhall/scip/Makefile, I have
CMAKE_SOURCE_DIR = /home/jajhall/scip
So
cd /home/jajhall/scip
mkdir build
cd build
cmake .. # add your options
make
ctest
does not work? Also not after a fresh clone?
See also https://scipopt.org/doc/html/md_INSTALL.php#CMAKE
Still doesn't work after a fresh clone. Could it be that my options are stopping the test from being created?
cmake .. -DPAPILO=off -DLPS=highs -DHIGHS_DIR=/home/jajhall/HiGHS/build -DCMAKE_BUILD_TYPE=Debug -DREADLINE=off -DGMP=off -DZIMPL=off -DIPOPT=off
Yes, good guess. It is not your build options, but probably an optional dependency for executing the unit tests. You need to install https://github.com/Snaipe/Criterion first in order to run this test. Your cmake output should show you that Criterion has been found, then the ctest -R glbcons should work, too.
Thanks, but building Criterion from source fails, and I don't know where to install their binaries
The README says there are packages for Ubuntu and other distributions, so apt-get install ... should work.
apt-get install libcriterion-dev E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
Looks pretty flaky software to me
I guess you need sudo apt-get install ... to have the permissions, nothing about criterion.
Of course!
I've reproduced the issue
However, I can't get meaningful output, or open the test in VScode. The log is LastTestsFailed.log
The associated executable, that use in VScode is /home/jajhall/scip/tests/cons/nonlinear/unittest-cons-nonlinear-glbconss, but (consistent with the .logfile) the failure seems to be in Criterion.
Yes, these unit tests are sometimes a bit painful to debug, because criterion catches asserts. If you just need more output, I created the log by a temporary patch, something like
diff --git a/src/lpi/lpi_highs.cpp b/src/lpi/lpi_highs.cpp
index b35ca748e6..293e93f787 100644
--- a/src/lpi/lpi_highs.cpp
+++ b/src/lpi/lpi_highs.cpp
@@ -658,6 +658,7 @@ SCIP_RETCODE SCIPlpiCreate(
#ifdef HIGHS_DEBUG
HIGHS_CALL( (*lpi)->highs->setOptionValue("highs_debug_level", 2) );
#endif
+ HIGHS_CALL( (*lpi)->highs->setOptionValue("log_dev_level", kHighsLogDevLevelVerbose) );
/* set default scaling */
SCIP_CALL( SCIPlpiSetIntpar(*lpi, SCIP_LPPAR_SCALING, 1) );
diff --git a/tests/src/cons/nonlinear/glbconss.c b/tests/src/cons/nonlinear/glbconss.c
index da110ee2b6..b8fc1756fe 100644
--- a/tests/src/cons/nonlinear/glbconss.c
+++ b/tests/src/cons/nonlinear/glbconss.c
@@ -676,6 +676,7 @@ static
void setup(void)
{
SCIP_CALL( SCIPcreate(&scip) );
+ SCIP_CALL( SCIPsetBoolParam(scip, "display/lpinfo", TRUE) );
/* include default plugins */
SCIP_CALL( SCIPincludeDefaultPlugins(scip) );```