38
H. Murai et al.
The above is equivalent to the below.
XcalableMP C
#pragma xmp align a[i] with t[i]
:
#pragma xmp loop on t[i]
for(int i=0;i 5
a[i] = 1.0;
XcalableMP Fortran
!$xmp align a(i) with t(i)
:
!$xmp loop on t(i)
do i=1, N
5
a(i) = 1.0
enddo
This construct can also be applied to multi-dimensional arrays.
XcalableMP C
#pragma xmp align a[i][j] with t[i][j]
:
#pragma xmp array on t[:][:]
a[:][:] = 1.0;
XcalableMP Fortran
!$xmp align a(j,i) with t(j,i)
:
!$xmp array on t(:,:)
a(:,:) = 1.0
Note The template appearing in the on clause must have the same shape as the
arrays in the following statement. The right-hand side value in this construct must be
identical among all nodes because the array construct is a global (i.e. collective)
operation.
4 Data Communication
4.1 shadow Directive and reflect Construct
Stencil computation frequently appears in scientific simulation programs, where, to
update an array element a[i], its neighboring elements a[i-1] and a[i+1] are
referenced. If a[i] is on the boundary region of a block-distributed array on a
node, a[i+1] may reside on another (neighboring) node.
Précédent

- 46/265

Suivant