Using NOWAIT
C$OMP PARALLEL
C$OMP DO SCHEDULE(STATIC)
do i=1,n
a(i)=...
enddo
C$OMP END DO NOWAIT
C$OMP DO SCHEDULE(STATIC)
do i=1,n
b(i)=a(i)**2
enddo
C$OMP END PARALLEL
Assume 2 threads
With STATIC schedule
1st thread: 1 to n/2
2nd thread: n/2+1 to n
Same for second loop
Dynamic schedule
No guarantee on which thread executes iterations
Previous slide
Next slide
Back to first slide
View graphic version