default-present not working with manual deepcopy of types

Hi,

I have a problem that I have worked around but thought I would share.

I am using manual deepcopy (the beta deepcopy feature was giving me too many problems…).

So I create data like this:

!$acc enter data create(a,a%r,a%t,a%p)

When I try to use the derived type in a parallel or kernels region, I am using the “default(present)” clause.

When I do this I get runtime errors (usually of the type of “such and such is partially on the device”).

In order to get around this, I always have to declare the type pointer present directly. So now I do things like:

!$acc parallel loop default(present) present(a)

(I still use the default(present) to cover all the other non-typed arrays in the loop).

Hi sumseq,

I’ve seen this before myself but hadn’t reported it so thanks for the reminder. I added TPR#24869 using one of my sample codes and have sent it engineering for investigation.

-Mat

Hi,

I have tested this issue with PGI 18.4.

For single-level derived types it seems that the issue has been fixed for some of my loops but remains broken for others (I can’t seem to find a pattern when it works and when it does not).

For types with more than one level, the problem is there always.

I have a type that has fields such as ab%r0%t(:,:).

When I have default(present) on the loop AND present(ab) everything works fine, but when I just have default(present) it does not work (crashes). It looks like the default(present) algorithm is not aware it needs to add ab%r0 to the present table as this output implies:

27736, Generating implicit present(ab%r0%t(:,:),ab%r1%p(:,:),ab%r1%t(:,:),ab,a,a%t(:,:,:),a%p(:,:,:),ab%r0%p(:,:))

Here is an example where I have to use the"present" for single-level types:

!$acc parallel default(present) present(vp,dgv,v,rhs,jxb,vdgv)
!$acc loop collapse(3)
        do k=2,npm1
          do j=2,ntm1
            do i=2,nrm-1
              avrho=AVGR(rho,i+1,j,k)
              dv=r(i)**2*dr(i)*dth(j)*sth(j)*dph(k)
              vp%r(i,j,k)= v%r(i,j,k)
     &                    +dtime*(-betapc_v_flow*vdgv%r(i,j,k)
     &                            +betapc_v_wave*jxb%r(i,j,k)/avrho)
              rhs%r(i,j,k)=dv*avrho*vp%r(i,j,k)-dgv%r(i,j,k)
            enddo
          enddo
        enddo
!$acc end parallel

Thanks!

  • Ron