openmp : check if nested parallesim
问题 Assume I have a method that multiplies two std::vector : double multiply(std::vector<double> const& a, std::vector<double> const& b){ double tmp(0); /*here I could easily do a parallelization with*/ /*#pragma omp parallel loop for*/ for(unsigned int i=0;i<a.size();i++){ tmp += a[i]*b[i]; } return tmp; } If I set in this function the pragma macro, a call to multiply(...) will run on all threads. Now assume that somewehere else I want to do many vector multiplication : void many_multiplication