[Coin-discuss] Multi-threaded mode for Cbc/Clp
Ted Ralphs
tkralphs at lehigh.edu
Sun Mar 25 23:33:31 EDT 2007
My guess is that it will work fine, but the easiest thing to do is try
it! I guess you could also do it with a shell script, if this is all you
are doing...
Cheers,
Ted
YANG YUAN wrote:
>
> Hi Ted,
>
> Thanks for the quick reply. Actually, i am not expecting Cbc itself to
> run parallelly. In my case, I am coding my own algorithm, where Cbc is
> called as a library for solving IPs. The parallelization is in my own
> code, where i hope multiple processors are able to call Cbc and solve
> multiple IPs concurrently. For instances:
>
> #pragma omp parallel
> {
> ......
> #pragma omp for
> for ( ... ) {
> ......
> OsiSolverInterface *si;
> si = new OsiCbcSolverInterface();
> si->loadFromCoinModel(Parallel_model, true);
> if(MIP)
> si->branchAndBound();
> else
> si->initialSolve();
> ......
> }
> }
>
> I have taken care of the private and public variables. Do you think it
> will work parallelly as expected? or libCbc and libOsiCbc just can't be
> called in this way.
>
> Thanks -- yang
>
> On 3/23/07, *Ted Ralphs* <tkralphs at lehigh.edu
> <mailto:tkralphs at lehigh.edu>> wrote:
>
> Yang,
>
> OpenMP does not do any "automatic" parallelization. OpenMP is just a
> standard set of compiler directives that tell an OpenMP-aware compiler
> how to parallelize things. I don't see any OpenMP directives in Cbc
> source code (they all start with "#pragma omp"), so it doesn't look like
> it will run in parallel. In principle, it's not that difficult to
> parallelize a tree search algorithm using OpenMP, but if you're not the
> author of the code, that would probably make it significantly more
> difficult. Also, the code has to be thread-safe to begin with. It
> didn't
> take me that long to convert SYMPHONY, only adding a few dozen lines of
> code.
>
> Cheers,
>
> Ted
> --
> Dr. Ted Ralphs
> Associate Professor
> Industrial and Systems Engineering
> Lehigh University
> (610)758-4784
> tkralphs at lehigh.edu <mailto:tkralphs at lehigh.edu>
> www.lehigh.edu/~tkr2 <http://www.lehigh.edu/~tkr2>
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org <mailto:Coin-discuss at list.coin-or.org>
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
--
Dr. Ted Ralphs
Associate Professor
Industrial and Systems Engineering
Lehigh University
(610)758-4784
tkralphs at lehigh.edu
www.lehigh.edu/~tkr2
More information about the Coin-discuss
mailing list