lundi 13 avril 2015

C++ openmp parallelize std::vector loop

I have an issue with openmp. I'm trying to parallelize following C++ for loop, allWires is a std::vector of type Wire*, and Wire is a class defined by myself. initProcess(const Lib&) is member function of class Wire, library is an object of Lib, which is also defined by myself. There is no memory sharing in all Wire objects, and I expect this piece of code could be perfectly parallelized, but I didn't see any performance improvement by using openmp. Did I do wrong with openmp?



uint32_t wireCnt = allWires.size();
#pragma omp parallel for
for (uint32_t i = 0; i < wireCnt; ++i)
{
allWires[i]->initProcess (library);
}

Aucun commentaire:

Enregistrer un commentaire