


















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















































5
Fork
Join
Start
End
Fork
Join
Start
End
Idle
8
http://www.openmp.org Current spec is OpenMP 3. 318 Pages (combined C/C++ and Fortran)
Automatically divides work among threads
16
#pragma omp parallel { #pragma omp for for (i=0;i< MAX; i++) { res[i] = huge(); } } #pragma omp parallel for for (i=0;i< MAX; i++) { res[i] = huge(); }
17
void work(float c, int N) { #pragma omp parallel for private(x,y)**^ float x, y; int i; for(i=0; i<N; i++) { x = a[i]; y = b[i]; c[i] = x + y; }^ }
19
#pragma omp parallel for schedule (static, 8) for( int i = start; i <= end; i += 2 ) { if ( TestForPrime(i) ) gPrimesFound++; }
Iterations are divided into chunks of 8