<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div> Hello Stefan,<br>
<br>
Thanks for your answer! <br>
<br>
I tried what you said:<br>
# cbc file.lp -threads 2 -solve -quit,<br>
and it worked fine: as soon as the Branch-and-Cut begins, both processors are working for a total CPU usage of 100%: good!<br>
<br>
To obtain the same behavior from my C++ code, I just had to do:<br>
CbcMain0(mip);<br>
const char * arguments[5]={"","-threads", "2", "-solve", "-quit"};<br>
int returnCode = CbcMain1(5, arguments, mip);<br>
and it worked also.<br>
<br>
Thanks!<br>
<br>
Joel.<br>
<br>
</div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;">----- Message d'origine ----<br>De : Stefan Vigerske <stefan@math.hu-berlin.de><br>À : Joel Joel <joel_31415@yahoo.fr><br>Cc : cbc@list.coin-or.org<br>Envoyé le : Lundi, 6 Octobre 2008, 18h33mn 56s<br>Objet : Re: Re : [Cbc] Parallel version of Cbc<br><br>Hi,<br><br>> I have commented the line 112 of the file CbcModel.cpp in order to undefine "small" as you suggested and it compiled fine.<br>> <br>> 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%.<br>> The bevahior seems very similar to the non-parallel version of Cbc... <br>> <br>> Do I have to change something when I call Cbc from my code (to indicate to Cbc, for example, the number of CPU) ?
<br><br>You have to tell CBC how many threads to use.<br>E.g., cbc -threads 3 ...<br>uses 3 threads.<br>There are also special meanings for values larger 100. I copy some text <br>from John:<br><br>The idea was that if 100+n then the heuristics such as RINS which do <br>branch and bound on a reduced model would also use threads. If 200+n <br>then at root node (i.e. before threads are useful) then the cut <br>generators would be done in parallel. 300+n was meant to be both. <br>200+n might be a good idea - but may be broken.<br><br>>> - Is it currently possible to compile a parallel version of Cbc or is it too early? If yes, what am I doing wrong? <br> ><br>> <br>> Works fine for me.<br><br>I forgot to say: Don't try something special, I doubt it had been tested <br>for more than "give a mip - call solve - get solution" ;-).<br><br>Stefan<br><br>-- <br>Stefan Vigerske<br>Humboldt University Berlin, Numerical Mathematics<br><a
href="http://www.math.hu-berlin.de/%7Estefan" target="_blank">http://www.math.hu-berlin.de/~stefan</a><br></div></div></div><br>
</body></html>