[Clp] Performance test much worse than GLPK, any way to optimize it?

ycollette.nospam at free.fr ycollette.nospam at free.fr
Wed Jul 1 03:09:34 EDT 2015


Hello,

I build a cmake file to allow compilation of Cbc / Clp ... and glpk
This cmakefile allow to launch tests (miplib, and other tests available on the coinor site) and check objective function value for most of the tests.

To build Cbc / Clp with cmake:
Clone the repo at https://github.com/ycollet/coinor-cmake
git clone https://github.com/ycollet/coinor-cmake.git

Clone, the trunk of Cbc
svn co https://projects.coin-or.org/svn/Cbc/trunk Cbc-svn

Copy the cmakefiles into cbc:
cp -r coinor-cmake/Cbc/* Cbc-svn/

Then launch cmake:
cd Cbc-svn
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=~/cbc-bin -DCOIN_ENABLE_DOWNLOAD_DATA_TEST=ON -DCOIN_ENABLE_DOWNLOAD_ZLIB=ON ..
make

To launch the tests:
In the Cbc-svn/build directory:

ctest -LE LONG 

The -LE flag is for Label Exclude: I exclude long tests from the list of tests to be launched.
To restrict the set of tests to the one used by clp:

ctest -LE LONG -R clp

For glpk, it's nearly the same:
Clone the glpk cmakefiles repo:
git clone https://github.com/ycollet/glpk-cmake.git

Download the last version of glpk.
Copy the cmake files into glpk directory:

cp -r glpk-cmake/* glpk-4.55/

Launch cmake:
cd glpk-4.55
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=~/glpk-bin -DCOIN_ENABLE_DOWNLOAD_DATA_TEST=ON -DCOIN_ENABLE_DOWNLOAD_ZLIB=ON ..
make

To launch the tests:
In the glpk-4.55/build directory:

ctest -LE LONG 

This same procedure works fine too on windows. There is just a small difference ...

Open a Visual Studio Dos console.

Clone the glpk cmakefiles repo:
git clone https://github.com/ycollet/glpk-cmake.git

Download the last version of glpk.
Copy the cmake files into glpk directory:

xcopy glpk-cmake/ glpk-4.55/ (to be verified, I have a little doubt about this command).

Launch cmake:
cd glpk-4.55
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=~/glpk-bin -DCOIN_ENABLE_DOWNLOAD_DATA_TEST=ON -DCOIN_ENABLE_DOWNLOAD_ZLIB=ON - G "NMake Makefiles" ..
nmake

To launch the tests:
In the glpk-4.55/build directory:

ctest -LE LONG 

I was also able to build Cbc / Clp using mingw on Fedora. To be checked for glpk ...

Best regards,

YC


----- Mail original -----
De: "Emerson" <emersonxsu at gmail.com>
À: "Michael Hennebry" <hennebry at web.cs.ndsu.nodak.edu>
Cc: clp at list.coin-or.org
Envoyé: Mercredi 1 Juillet 2015 05:47:24
Objet: Re: [Clp] Performance test much worse than GLPK,	any way to optimize it?



Hi Michael, 
Thanks for replying. Good news is : problem solved! 
I firstly used coinbuild but nothing changed. Then I changed the solver type from initialSolve( ) to Babak's suggestion: 








ClpSimplex *Model .... 




ClpSolve *solvectl; 




solvectl= new ClpSolve; 




solvectl->setSolveType(ClpSolve::useDual); 




solvectl->setPresolveType(ClpSolve::presolveOn); 




Model->initialSolve(*solvectl); 




delete solvectl; Although the pointer case doesn't work(don't know why), I changed it to ClpSimplex Model, and everything works! 

Now the performance increases so much, from 58 seconds down to 2 seconds on my network model, while GLPK takes 21 seconds. I hope everything goes well after this... 


Thanks all, 
Emer 


On Tue, Jun 30, 2015 at 6:48 PM, Michael Hennebry < hennebry at web.cs.ndsu.nodak.edu > wrote: 


The first thing is to know what you are measuring. 
CPU time and wall clock time can be rather different. 
Also, what events are you timing? 
Do your times include input and output times? 

-- 
Michael hennebry at web.cs.ndsu.NoDak.edu 
"SCSI is NOT magic. There are *fundamental technical 
reasons* why it is necessary to sacrifice a young 
goat to your SCSI chain now and then." -- John Woods 


_______________________________________________
Clp mailing list
Clp at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/clp



More information about the Clp mailing list