I am currently working on a professional code in order to parallelize it with pragmas of acceleration. It is a FORTRAN77’s & FORTRAN95’s code and it is out of mind to use some thing more complexe than pragmas.
When I compile it with the -Minfo=all option I get the following message :
index_line, Loop not parallelized: multiples exits
And unfortunately that is the loop that I want to paralelize ! So I’ve got a problem.
I would be pleased to get some helps, or guide lines in order to going through this problem.
Parallel regions need ot have single entry and exit point. This message typically means that your parallel region has an exit or goto statement in it. Note that they are allowed in serial portions of the code.
To fix, you either need to remove the early exit or use the schedule directives to make it serial.
For example, if you had:
!$acc region
do i=1, N
! do something
if (somecondition .eq. 1) then ! these three lines would need to be removed
exit
endif
enddo
For this case, we can parallelize the outer loop and have the inner loop serial. In this case the early exit from the inner loop is ok.
!$acc region
!$acc do kernel
do i=1, N
loop2: do j= 1, M
! do something
if (somecondition .eq. 1) then
exit loop2
endif
enddo
If you wan tot post code, I can help you figure out the best strategy for removing the early exit.