[Cbc] API crashes while standalone does not (follow up)
Alexis Guigue
aguigue at softree.com
Wed Aug 29 18:18:50 EDT 2012
Hi all,
I have been pursuing my investigations.
My original code was
OsiClpSolverInterface osiClpSolver;
....
try {
callCbc("-solve -quit", cbcSolver);
}
catch (CoinError e) {
e.print();
std::cout << "Crashing....\n";
if (e.lineNumber() >= 0) std::cout << "This was from a CoinAssert"
<< std::endl;
exit(EXIT_FAILURE);
}
It was working fine until I started to increase the size of the test
cases -> (40000 variables, 5000 constraints). Then, it suddendly
started to crash right in the middle of the optimization. Note that I am
not actually doing really anything to osiClpSolver. I am
just populating a matrix, so no special cutting, branching, etc..
implemented. Really nothing fancy.
Then, I added the lines where .... are
osiClpSolver.writeLp("test","lp");
osiClpSolver.writeMps("test","mps");
to save the model in the files test.lp and test.mps. When I run the
standalone CBC either with test.lp or test.mps, it does
not crash and produces the optimal solution.
Q: I am a bit surprised that the optimal value is not the same, but I
suspect it might related to the precision while reading/writing
the file. Am I right? How can this be fixed?
I have tried the following thing (kind of weird, but it is debugging
after all). In my code, I save the file and reload right away, so
it looks like this
OsiClpSolverInterface osiClpSolver;
...
osiClpSolver.writeMps("test","mps");
// Test
OsiClpSolverInterface solver1;
solver1.readMps("test","mps");
callCbc("-solve -quit", solver1);
/*
try {
callCbc("-solve -quit", cbcSolver);
}
catch (CoinError e) {
e.print();
std::cout << "Crashing....\n";
if (e.lineNumber() >= 0) std::cout << "This was from a CoinAssert"
<< std::endl;
exit(EXIT_FAILURE);
}
*/
It is the closest I can get to the standalone version and it crashes
too. What do you think? Any ideas?
I noticed that the standalone is based on the version 2.7.1, whereas I
am using 2.7.2. So, I am moving
my code to using version 2.7.1. I will keep you posted on my results.
Also, could 32 bits vs 64 bits be a factor?
Thanks
Cheers
Alexis
--
Software Engineer/Research Engineer
Softree Technical Systems Inc.
www.softree.com
Engineering an Easier Way
More information about the Cbc
mailing list