1
votes

What is the difference between :

 #pragma omp for
  {for_loop}

and

 #pragma omp parallel for
  {for_loop}
1
its not the same.... omp for and not simple omp - GedO
ok, my bad. It's not exactly the same, but it provides enough info to answer your question. I added an answer to your specific question. - mfnx

1 Answers

2
votes

#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 (...)
{}