[Cbc] Using parallel branch & bound

Sam Mathew sam.cfd.iitm at gmail.com
Mon Feb 27 01:20:36 EST 2017


Hi Jesse,

I myself have never used the C or C++ interface, but can share what I have
observed.

In the Cbc example folder, there is a parallel.cpp file which might help
you.

>From the JuMP documentation, I see that they access libCbcSolver.so
(located in your Cbc installation directory) and simply do a ccall with the
arguments (args...). You can notice this in
.julia/v0.5/Cbc/src/CbcCInterface.jl and .julia/v0.5/Cbc/deps/deps.jl files.

May be you are aware of the -cpp option while using CBC from command line.
If you set it to 1, and solve a model, it would generate C++ code
(user_driver.cpp, by default) that you might want to investigate. But I
could not figure out the threads option in it.

May be a more experienced user can shed more light.

Best regards,

Sam

Regards,

Sam

On 26 February 2017 at 18:11, Jesse Jaanila <jessejaanila at gmail.com> wrote:

> Hi Sam,
>
> Thanks, that did the trick. My other question would then be, how can I
> specify the how many threads the CbcModel object can use with branch and
> bound? Or does the models query my processor architecture at compile time
> and use a suitable amount of threads implicitly?
>
> I ask because there doesn't seem to be any setter methods for the number
> of threads. (Only getters: parallelMode() and numberThreads_).
>
> Jesse
>
> On Sun, Feb 26, 2017 at 1:31 PM, Sam Mathew <sam.cfd.iitm at gmail.com>
> wrote:
>
>> Hi Jesse,
>>
>> In order to use parallel, you need to do this while configuring during
>> installation of Cbc.
>>
>> The right step then would be (supposing you are in the build directory,
>> within the directory where CBC has been downloaded using SVN)
>>
>> ../configure --enable-cbc-parallel
>> make
>> make install
>>
>> It might help if you look at the fourth option on the following:
>> https://projects.coin-or.org/Cbc/wiki/FYI
>>
>> Then you can use the parallel version within C++.
>>
>> JuMP has it pre-configured to run parallel, so you did not need to do it
>> there.
>>
>> Regards,
>>
>> Sam
>>
>> On 25 February 2017 at 22:56, Jesse Jaanila <jessejaanila at gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> In the past, I have used CBC though Julia JuMP library, where running
>>> parallel branch & bound can be done easily by specifying the Threads=N
>>> argument for the solver. I'm now transferring some of my code to C++ and
>>> I'm not sure how to run the B&B parallel using C++. Is it trivial?
>>>
>>> What's worrisome is that model.haveMultiThreadSupport() returns false
>>> which suggest I don't even have the prerequisites for parallel B&B. I guess
>>> the quick start guide for Unix-like systems in
>>> https://projects.coin-or.org/Cbc doesn't include the necessary option
>>> for building CBC with parallel support. What actions should I take? I'm
>>> fine with rebuilding the whole set of libraries and dependencies.
>>>
>>> Thanks!
>>> Jesse
>>>
>>> _______________________________________________
>>> Cbc mailing list
>>> Cbc at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/cbc
>>>
>>>
>>
>>
>> --
>> Consultant
>>
>> *Gyan Data Pvt. Ltd.*
>> *IITM Research Park*
>>
>
>


-- 
Consultant

*Gyan Data Pvt. Ltd.*
*IITM Research Park*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20170227/eeac223a/attachment.html>


More information about the Cbc mailing list