[Coin-discuss] Multi-threaded mode for Cbc/Clp

YANG YUAN erry.yuan at gmail.com
Fri Mar 23 17:51:47 EDT 2007


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> 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
> www.lehigh.edu/~tkr2
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20070323/44c2440e/attachment.html>


More information about the Coin-discuss mailing list