Error: symbol `.STATICS3' is already defined

I receive the error " Error: symbol `.STATICS3’ is already defined" when I add a data region around some subroutines, the subroutines contain accelerator regions, i.e:

!$acc data region copy(u,v,f,feq,rho,omega,w,cx,cy)
call collesion(u,v,f,feq,rho,omega,w,cx,cy,n,m)
call streaming(f,n,m)
! ——————————–
call sfbound(f,n,m,uo)
call rhouv(f,rho,u,v,cx,cy,n,m)
!$acc end data region

and an example subroutine:

subroutine collision(u,v,f,feq,rho,omega,w,cx,cy,n,m)
real*8 f(0:8,0:n,0:m)
real*8 feq(0:8,0:n,0:m),rho(0:n,0:m)
real*8 w(0:8), cx(0:8),cy(0:8)
real*8 u(0:n,0:m), v(0:n,0:m)
!$acc region 
DO i=0,n
DO j=0,m
t1=u(i,j)*u(i,j)+v(i,j)*v(i,j)
DO k=0,8
t2=u(i,j)*cx(k)+v(i,j)*cy(k)
feq(k,i,j)=rho(i,j)*w(k)*(1.0+3.0*t2+4.50*t2*t2-1.50*t1)
f(k,i,j)=omega*feq(k,i,j)+(1.-omega)*f(k,i,j)
END DO
END DO
END DO
!$acc end region 
return
end

I can post more code if needed.

Hi mjmawson,

I can post more code if needed.

Please do. A small complete source that reproduces the problem would be ideal. If the code is too large to post, please send a report to PGI Customer Service (trs@pgroup.com)

Note you need to add a reflected directive in collision in order for the compiler to know that arguments have already been copied to the device. For example:

subroutine collision(u,v,f,feq,rho,omega,w,cx,cy,n,m)
real*8 f(0:8,0:n,0:m)
real*8 feq(0:8,0:n,0:m),rho(0:n,0:m)
real*8 w(0:8), cx(0:8),cy(0:8)
real*8 u(0:n,0:m), v(0:n,0:m)
!$acc reflected (u,v,f,feq,rho,omega,w,cx,cy)
!$acc region
DO i=0,n
DO j=0,m
t1=u(i,j)*u(i,j)+v(i,j)*v(i,j)
DO k=0,8
t2=u(i,j)*cx(k)+v(i,j)*cy(k)
feq(k,i,j)=rho(i,j)*w(k)*(1.0+3.0*t2+4.50*t2*t2-1.50*t1)
f(k,i,j)=omega*feq(k,i,j)+(1.-omega)*f(k,i,j)
END DO
END DO
END DO
!$acc end region
return
end
  • Mat

Cheers, all sorted now.