1.A.2 Parallel Loop Model
Note threads, shared, local
program
c$omp parallel do
c$omp& shared(A) private(I)
do I=1,100
. . .
enddo
c$omp end parallel
end
A is shared
Parallel Do
I=1
I=2
I=3
I=4
I=5
I=6
A
Several, e.g. 4, threads
created on entry
Iterations
scheduled
on threads
I is local
Threads
barrier at end
Threads either spin or
sleep between regions
Previous slide
Next slide
Back to first slide
View graphic version