In my MPI+OpenACC code I do the following:
!$acc host_data use_device(a(:,:,:))
call MPI_ROUTINE(a(:,:,:))
!$acc end host_data
where “a” is on the device from a previous “acc enter data copyin”.
In the new OpenACC book (pg. 283) an example similar to mine is shown but with the above block within an “acc data present(a)” clause, i.e.
!$acc data present(a(:,:,:))
!$acc host_data use_device(a(:,:,:))
call MPI_ROUTINE(a(:,:,:))
!$acc end host_data
!$acc end data
Is it required to explicitly say “acc data present()” before using “acc host_data use_device(a)”?
I would think that the host_data clause would assume the array was on the device.
My code seems to work on my local machine both ways.
Which is “correct”?
- Ron