What is the difference between these two?
[A]
#pragma omp parallel
{
#pragma omp for
for(int i = 1; i < 100; ++i)
{
...
}
}
[B]
#pragma omp parallel for
for(int i = 1; i < 100; ++i)
{
...
}
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: