Hello,
I’m trying to parallelize a function of a program. This function is defined in a module of the program. The code below is from the function
do ic = 1,nc
imp = endpht(ip-1) + ic
i = lstpht(imp)
il = ilocal(i)
iu = indxuo(i)
ia = iaorb(i)
is = isa(ia)
iop = listp2(imp)
! Generate or retrieve phi values
if (DirectPhi) then
if (ia.ne.lasta .or. iop.ne.lastop) then
lasta = ia
lastop = iop
do isp = 1,nsp
dxsp(:) = xdsp(:,isp) + xdop(:,iop) - dxa(:,ia)
r2sp = sum(dxsp**2)
if (r2sp.lt.r2cut(is)) then
call all_phi( is, +1, dxsp, nphiloc, phia(:,isp) )
else
phia(:,isp) = 0.0_dp
endif
enddo
endif
iphi = iphorb(i)
Clocal(:,ic) = phia(iphi,:)
else
Clocal(:,ic) = phi(:,imp)
endif
enddo
When I tried to apply the parallel directive to this loop, in the compilation stage, compiler PGI 12.6 said
298, Accelerator restriction: function/procedure calls are not supported
300, sum reduction inlined
302, Accelerator restriction: function/procedure calls are not supported
0 inform, 1 warnings, 0 severes, 0 fatal for rhoofd
This warning was caused by calling function all_phi. I commented out the first part of the IF statement like this:
do ic = 1,nc
imp = endpht(ip-1) + ic
i = lstpht(imp)
il = ilocal(i)
iu = indxuo(i)
ia = iaorb(i)
is = isa(ia)
iop = listp2(imp)
! Generate or retrieve phi values
! if (DirectPhi) then
! if (ia.ne.lasta .or. iop.ne.lastop) then
! lasta = ia
! lastop = iop
! do isp = 1,nsp
! dxsp(:) = xdsp(:,isp) + xdop(:,iop) - dxa(:,ia)
! r2sp = sum(dxsp**2)
! if (r2sp.lt.r2cut(is)) then
! call all_phi( is, +1, dxsp, nphiloc, phia(:,isp) )
! else
! phia(:,isp) = 0.0_dp
! endif
! enddo
! endif
! iphi = iphorb(i)
! Clocal(:,ic) = phia(iphi,:)
! else
Clocal(:,ic) = phi(:,imp)
! endif
enddo
When I tried to compile the module, I got the following error:
pgfortran -c -g -acc -ta=nvidia -Minfo=all,ccff
FoX/FoX-config --fcflags
<path_to_the_module>
PGF90-F-0000-Internal compiler error. max_ili_ili argument error 0
(<path_to_the_module>:<error_line>)
make: *** [rhoofd.o] Error 2
What should I do to fix this internal compiler error?
Thank you.