jockel
Joined: 15 Dec 2010 Posts: 5
|
Posted: Mon Dec 17, 2012 12:50 pm Post subject: correct subarray in data regions |
|
|
Hello,
we wonder, which is the correct / safe / fast method do declare the subarray in a data region with OpenACC.
Lets assume an array allocated as
| Code: | | AA(0:Imax+1,0:Jmax+1,0:Kmax+1,Maxblocks) |
This variable is used as shown here:
| Code: | DO iBlock = 1, Maxblocks
!here, the complete subarray for Block iBlock should be copied
!$acc data
!$acc& copy(AA(xxxxx))
...
...some code...
DO K=1,Kmax
DO J=1,Jmax
DO I=1,Imax
...some code...
ENDDO
ENDDO
ENDDO
...some code...
...
!$acc end data
END DO |
How should the contiguous subarray (for the actual block iBlock) of AA be declared in the data-region (create, copy, update,...) and what are the differences in the following methods:
1. AA(:,:,:,iBlock)
2. AA(:,:,:,iBlock:iBlock)
3. AA(0:Imax+1,0:Jmax+1,0:Kmax+1,iBlock)
4. AA(0:Imax+1,0:Jmax+1,0:Kmax+1,iBlock:iBlock)
(we also copy the halos / dummy cells in order to have a contiguous data transfer)
Many thanks in advance! |
|