Is there any reason to use 2nd construct if I have only 1 for loop and nothing else? Thank you!
#pragma omp parallel for
// for loop goes here
#pragma omp parallel
{
#pragma omp for
// for loop goes here
}
With most implementations the first structure will only have one implicit barrier, while the second may have two (depending on how good the implementation is at removing redundant barriers). If the implementation is good though, you shouldn't see any difference between the two.
I totally second what ejd said.
I would add the fact that one may use the nowait
clause so that the threads do not synchronize at the end of the parallel loop.