Reputation: 11
What is the difference between :
#pragma omp for
{for_loop}
and
#pragma omp parallel for
{for_loop}
Upvotes: 1
Views: 509
Reputation: 3018
#pragma omp parallel
This spawns a group of threads.
#pragma omp for
This divides the loop iterations between the threads.
Basically,
#pragma omp parallel
#pragma omp for
for (...)
{}
is the same as
#pragma omp parallel for
for (...)
{}
Upvotes: 3