i am trying to parallel my program using OpenMP and sometimes i feels that i am reaching a dead end.
I would like to share variables in a function member that i defined (and initialized) in the class. If i understood correctly, it is not possible doing #pragma omp parallel shared(foo)
of data members (e.g. int
, boost::multi_array
and std::vector
) of a class.
e.g.: using push_back() on a vector data member in the class.
updating values of a boost::multi_array
.
My question is if OpenMP is the right tools for it, or should i use boost::thread or tbb? or something else... what support C++ API
Reagrds
shared
clause is actually redundant – any variable declared outside the parallel block that is not declared asprivate
(or any of the other options) is automatically shared. – Elwaine