20
H. Murai et al.
a[i][*] / a(*,i)
t[i] / t(i)
p[0], p(1)
p[1], p(2)
p[2], p(3)
p[3], p(4)
Fig. 17 Example of array alignment (3)
p[0], p(1)
p[1], p(2)
p[2], p(3)
p[3], p(4)
a[i] / a(i)
t[i][*] / t(*,i)
Fig. 18 Example of array alignment (4)
XcalableMP C
#pragma xmp nodes p[4]
#pragma xmp template t[8]
#pragma xmp distribute t[block] onto p
int a[8];
5 #pragma xmp align a[i] with t[i]
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t(8)
!$xmp distribute t(block) onto p
integer :: a(8)
5 !$xmp align a(i) with t(i)
The array a is decomposed and laid out so that each element a(i) is colocated
with the corresponding template element t(i) (Fig. 15).
The align directive can also be used for multi-dimensional arrays (Fig. 16).
XcalableMP C
#pragma xmp nodes p[2][2]
#pragma xmp template t[8][8]
#pragma xmp distribute t[block][block] onto p
H. Murai et al.
a[i][*] / a(*,i)
t[i] / t(i)
p[0], p(1)
p[1], p(2)
p[2], p(3)
p[3], p(4)
Fig. 17 Example of array alignment (3)
p[0], p(1)
p[1], p(2)
p[2], p(3)
p[3], p(4)
a[i] / a(i)
t[i][*] / t(*,i)
Fig. 18 Example of array alignment (4)
XcalableMP C
#pragma xmp nodes p[4]
#pragma xmp template t[8]
#pragma xmp distribute t[block] onto p
int a[8];
5 #pragma xmp align a[i] with t[i]
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t(8)
!$xmp distribute t(block) onto p
integer :: a(8)
5 !$xmp align a(i) with t(i)
The array a is decomposed and laid out so that each element a(i) is colocated
with the corresponding template element t(i) (Fig. 15).
The align directive can also be used for multi-dimensional arrays (Fig. 16).
XcalableMP C
#pragma xmp nodes p[2][2]
#pragma xmp template t[8][8]
#pragma xmp distribute t[block][block] onto p
