[Cbc] --enable-cbc-parallel on Windows using MinGW/MSYS

Michal Kaut mail at michalkaut.net
Thu Feb 12 05:33:25 EST 2009


Hello,

I am having some troubles getting Cbc to use more than one cpu core, 
using MinGW/MSYS on WinXP (in particular, using the lates MinGW build 
from http://www.tdragon.net/recentgcc/, which includes gcc 4.3.2 and the 
pthreads-win32 library).

First, I had to do a couple of changes to make it build:
1. include error from pthread.h, caused by the following lines:
#if HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */
My guess is that Cbc/Coin defines the macro HAVE_CONFIG_H somewhere and 
pthread.h then does not find config.h. I have solved it by commenting 
out the include line. An alternativecould be to create an empty config.h 
file in the MinGW/include folder.

2. "expected unqualified-id before '='" errors in 
CbcModel::solveWithCuts, caused by variables called "small" - the name 
conflicts with something... "small" is defined twice inside 
CbcModel::solveWithCuts (inside different blocks), first on line 7835 as 
bool and the on line 7991 as double. Changing the names solves the problem.

With these changes, Cbc builds and passes the tests - but seems to be 
using only one core on my dual-core machine. Is there some switch I need 
to use to make it use both cores?
I tested on a MIP problem with search tree  with >1000 nodes.
The env. variable NUMBER_OF_PROCESSORS is equal to 2 and I have also 
tried with OMP_NUM_THREADS=2, but it does not make any difference...

Thanks in advance for any help.

Regards,
Michal


PS:
I have noticed two strange things in CbcModel.cpp:
l. 7833:  if (whenC==999999|whenC==999998) {
  - should not it be "||" there?
l. 7835:  bool small = size<=550;
l. 7836:  small=false;
  - bit weird to initialize a variable and immediately change it..



More information about the Cbc mailing list