tags:

views:

439

answers:

1

I am a newbie to OpenMP (I began using it today)

What is the difference between these two?

[A]

#pragma omp parallel
{ 
#pragma omp for
 for(1...100)
 {
 }
}

[B]

#pragma omp parallel for
for(1..100)
{
}

Thanks in advance!

+1  A: 

I don't think there is any difference, one is a shortcut for the other. Although your exact implementation might deal with them differently.

"The combined parallel worksharing constructs are a shortcut for specifying a parallel construct containing one worksharing construct and no other statements. Permitted clauses are the union of the clauses allowed for the parallel and worksharing contructs."

Taken from http://www.openmp.org/mp-documents/OpenMP3.0-SummarySpec.pdf

The specs for OpenMP are here:

http://openmp.org/wp/openmp-specifications/

Ade Miller