OpenMP: conditional use of #pragma
问题 I'm using OpenMP to improve my program efficiency on loops. But recently I discovered that on small loops the use of this library decreased performances and that using the normal way was better. In fact, I'd like to use openMP only if a condition is satisfied, my code is #pragma omp parallel for for (unsigned i = 0; i < size; ++i) do_some_stuff (); But what I want to do is to disable the #pragma if size is small enough i.e.: if (size > OMP_MIN_VALUE) #pragma omp parallel for for (unsigned i =