does deepcopy work with host_data?

I am using deepcopy with PGI 17.7.

I am trying to do the following CUDA-aware MPI call:

!$acc enter data copyin(v)
c
!$acc host_data use_device(v)
      call MPI_Irecv (v%r(:,:,  1),lbuf3r,ntype_real,iproc_pm,tagr,
     &                comm_all,req(1),ierr)

but this does not work.

I instead have to do:

!$acc enter data copyin(v)
c
!$acc host_data use_device(v%r,v%t,v%t)
      call MPI_Irecv (v%r(:,:,  1),lbuf3r,ntype_real,iproc_pm,tagr,
     &                comm_all,req(1),ierr)

Is deepcopy not available for host_data yet?

Hi sumseq,

Deepcopy and host_data are separate things. Deepcopy has to do with implicitly copying of UDTs in data clauses, while host_data says to use the device pointer to the object in host code. Hence by saying “v” in the use_device clause, you’re telling the compiler to use the device copy of “v” on the host. If you were passing “v” itself, this would be fine. But here it will cause a seg fault since you dereferencing “v” on the host in order to get access to the data members. Using “v%r” and “v%t” would be the correct syntax.

Hope this helps,
Mat