[Cbc] Re : Parallel version of Cbc

Joel Joel joel_31415 at yahoo.fr
Tue Oct 7 03:54:33 EDT 2008


    Hello Stefan,

Thanks for your answer! 

I tried what you said:
# cbc file.lp -threads 2  -solve -quit,
and it worked fine: as soon as the Branch-and-Cut begins, both processors are working for a total CPU usage of 100%: good!

To obtain the same behavior from my C++ code, I just had to do:
    CbcMain0(mip);
    const char * arguments[5]={"","-threads", "2", "-solve", "-quit"};
    int returnCode = CbcMain1(5, arguments, mip);
and it worked also.

Thanks!

Joel.




----- Message d'origine ----
De : Stefan Vigerske <stefan at math.hu-berlin.de>
À : Joel Joel <joel_31415 at yahoo.fr>
Cc : cbc at list.coin-or.org
Envoyé le : Lundi, 6 Octobre 2008, 18h33mn 56s
Objet : Re: Re : [Cbc] Parallel version of Cbc

Hi,

> I have commented the line 112 of the file CbcModel.cpp in order to undefine "small" as you suggested and it compiled fine.
> 
> When I look at the CPU activity on my dual-core during the branch-and-cut, apparently both CPU seems to work, but the total CPU usage remains close to 50%.
> The bevahior seems very similar to the non-parallel version of Cbc... 
> 
> Do I have to change something when I call Cbc from my code (to indicate to Cbc, for example, the number of CPU) ? 

You have to tell CBC how many threads to use.
E.g., cbc -threads 3 ...
uses 3 threads.
There are also special meanings for values larger 100. I copy some text 
from John:

The idea was that if 100+n then the heuristics such as RINS which do 
branch and bound on a reduced model would also use threads.  If 200+n 
then at root node (i.e. before threads are useful) then the cut 
generators would be done in parallel.  300+n was meant to be both. 
200+n might be a good idea - but may be broken.

>> - Is it currently possible to compile a parallel version of Cbc or is it too early? If yes, what am I doing wrong? 
>
> 
> Works fine for me.

I forgot to say: Don't try something special, I doubt it had been tested 
for more than "give a mip - call solve - get solution" ;-).

Stefan

-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/cbc/attachments/20081007/95c447a8/attachment.html 


More information about the Cbc mailing list