Closed sagitter closed 2 years ago
This looks pretty easy to fix. A PR would be most welcome! Looks like the same issue is present in master
so it probably makes sense to do the PR against the master
branch.
I fixed this up in stable/2.10 for now. Can you try whether that is sufficient for you? The OS developers haven't been active for 2 years, so not sure how likely it is that someone would try to fix any failing tests.
I can cherry-pick to master when we are done here.
Sorry for my late reply.
Change in https://github.com/coin-or/OS/commit/2a7dd973a031a48d5de832f43b5f5fec5cf17dca is applied but Cspd
solver test is failing:
TEST 15: CSDP solver on SDPA_ex.osil
create a new Csdp Solver for OSiL string solution
call the Csdp Solver
CSDP 6.2.0
Iter: 0 Ap: 0.00e+00 Pobj: 3.0434379e+02 Ad: 0.00e+00 Dobj: 0.0000000e+00
Iter: 1 Ap: 8.36e-01 Pobj: 3.6123735e+01 Ad: 1.00e+00 Dobj: 3.6192774e+01
Iter: 2 Ap: 9.91e-01 Pobj: 1.7890107e+00 Ad: 1.00e+00 Dobj: 3.4979250e+01
Iter: 3 Ap: 1.00e+00 Pobj: 1.5056174e+00 Ad: 1.00e+00 Dobj: 8.0480383e+00
Iter: 4 Ap: 1.00e+00 Pobj: 1.8308676e+00 Ad: 1.00e+00 Dobj: 3.3375932e+00
Iter: 5 Ap: 9.97e-01 Pobj: 2.6201334e+00 Ad: 1.00e+00 Dobj: 3.0665240e+00
Iter: 6 Ap: 1.00e+00 Pobj: 2.7034721e+00 Ad: 1.00e+00 Dobj: 2.7846974e+00
Iter: 7 Ap: 1.00e+00 Pobj: 2.7475837e+00 Ad: 1.00e+00 Dobj: 2.7511007e+00
Iter: 8 Ap: 1.00e+00 Pobj: 2.7499233e+00 Ad: 9.98e-01 Dobj: 2.7500315e+00
Iter: 9 Ap: 1.00e+00 Pobj: 2.7499976e+00 Ad: 9.98e-01 Dobj: 2.7499990e+00
Iter: 10 Ap: 1.00e+00 Pobj: 2.7499999e+00 Ad: 9.99e-01 Dobj: 2.7500000e+00
Iter: 11 Ap: 9.70e-01 Pobj: 2.7500000e+00 Ad: 9.70e-01 Dobj: 2.7500000e+00
Success: SDP solved
Primal objective value: 2.7500000e+00
Dual objective value: 2.7500000e+00
Relative primal infeasibility: 9.70e-17
Relative dual infeasibility: 7.62e-10
Real Relative Gap: 2.02e-10
XZ Relative Gap: 4.80e-10
DIMACS error measures: 1.05e-16 0.00e+00 2.24e-09 0.00e+00 2.02e-10 4.80e-10
Csdp solver solution for SDPA_ex checks.
now test matrix extensions to OSrL
Read OSrL string
Write OSrL string
THE UNIT TEST PASSED THE FOLLOWING:
TEST 1: Reading files successfully
TEST 2: Passed lossless IO test
TEST 3: Successful test of nonlinear operators using file testOperators.osil
TEST 4: Successful test of AD gradient and Hessian calculations
TEST 5: Solved problem parincLinearByRow.osil with Clp
TEST 6: Warmstarts for problem parincLinear.osil with Clp
TEST 7: Solved problem p0033.osil with Cbc
TEST 8: Solved problem p0033.osil with SYMPHONY
TEST 9: Solved problem parincLinear.osil with DyLP
TEST 10: Solved problem volumeTest.osil with Vol
TEST 11: Solved problem p0033.osil with GLPK
TEST 12: Solved problem avion2.osil with Ipopt
TEST 13: Solved problem bonminEx1.osil with Bonmin
TEST 14: Solved problem bonminEx1.osil with Couenne
UNFORTUNATELY, YOU FAILED ON THE FOLLOWING:
Test 15: Unit Test Failed Testing the Csdp Solver:
OSrL reader/writer loses information in matrix extensions
Conclusion: FAILURE
make[1]: *** [Makefile:707: test] Error 1
That seems to be a bug with the IsEqual() implementation
of OSResult
and all classes used by it.
There is a lot of code like
if (!this->generalStatus->IsEqual(that->generalStatus))
return false;
[...]
bool GeneralStatus::IsEqual(GeneralStatus *that)
{
std::ostringstream outStr;
#ifndef NDEBUG
osoutput->OSPrint(ENUM_OUTPUT_AREA_OSResult, ENUM_OUTPUT_LEVEL_trace, "Start comparing in GeneralStatus");
#endif
if (this == NULL)
{
if (that == NULL)
return true;
[...]
all over the place.
However, the check this == NULL
does not work reliably if this
is NULL
.
There should be a check for this->generalStatus == NULL
in the first code snippet.
I guess this is due to compiler optimizations, so I put some #ifdef
around the test that should disable it in a non-debug build of OS.
I created a follow-up issue for the last thing.
Hi Stefan.
Thank for your help. The test error in https://github.com/coin-or/OS/issues/69#issuecomment-891741254 is still there also after change from https://github.com/coin-or/OS/commit/588350e0c04a77599292064960f8e68869935f2c
Hmm, ok. I took it out completely now.
Hi all.
unitTest.cpp
is not compiled in Fedora 35 (coin-or-OS-2.10.2 and GCC-11.1.1) with following error: