[Cbc] Cbc + openmp

Babak Moazzez bmoazzez at ucdavis.edu
Tue Apr 19 18:06:33 EDT 2016


Hi

 I am using Cbc solver with openmp in a c++ code in the following way:

OsiClpSolverInterface  s1;
OsiClpSolverInterface  s2;
OsiClpSolverInterface  s3;

s1->readMps("model.mps");
s2->readMps("model.mps");
s3->readMps("model.mps");

CbcModel m1(s1);
CbcModel m2(s2);
CbcModel m3(s3);

put models in an array M;

#pragma omp parallel for
    for(int i=0; i<3; ++i)
          callCbc("some tuning",M[i])

So as you see, the three models are independent. tuning is different for
each thread.

My question is : Is it safe to do such thing? It seems that once a
parameter is set in callCbc in one thread, other threads have that argument
set too. Is it possible? Can I call different versions of callCbc
independently in different threads?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20160419/d6f9108f/attachment.html>


More information about the Cbc mailing list