- Code: Select all
do .....
call .....
call .....
if .....
do .....
end do .....
else .....
do .....
end do .....
end if .....
end do .....
I am having difficulty in running the call sequences through parallel due to the complexity of the code itself. As an alternate strategy I am attempting to run the outer do loop in parallel and have it run through one thread when it gets to the call spots. Is it possible to format OpenMP like below?
- Code: Select all
!$OMP PARALLEL
!$OMP DO
do .....
!$OMP SINGLE
call .....
call .....
!$OMP END SINGLE
if .....
do .....
end do .....
else .....
do .....
end do .....
end if .....
end do .....
!$OMP END DO
!$OMP END PARALLEL
I want to have the section split up the loop into multiple threads, but I don't want all of the threads to do all of the work and each give me a separate answer. That is why I want to include the OMP DO, but I am having trouble with this setup. Any ideas on a better way to do it?
