hallo everyone,
i have a confusion about the parallel loop with nowait, see the example below:
...
!$omp parallel
...
do j=1,3
!$omp do
do i=1,4000
a(i,j)=...
enddo
!$omp end do nowait
endo do
...
!$omp end parallel
...
we assume this code is running on 4 threads, and the thread No. 3 is a much faster than No. 0.
so because of different compute ability, the situation may be like this:
thread 3 have just finished computing j=2, and start to do j=3, then it encounter !$omp do, while thread 0 is still doing j=1.
then the OpenMP api need to distribute the mission of j=3 to 4 threads.
my question is : does thread 0 know which section of the loop to do in j=3? and MORE IMPORTANT, does thread 0 know which section to do in j=2 ?????
do we need to guaranty that if one thread start doing j=3, all the other threads MUST had finished j=1,meanwhile ,doing j=2 at least.
and another quetion:is the first thread enconter the parallel loop do the first section of the loop, say i=1,1000 in this case?
thanks a lot!
