XcalableMP Programming Model and Language
19
XcalableMP C
#pragma xmp nodes p[4]
#pragma xmp template t[10][10]
#pragma xmp distribute t[block][ * ] onto p
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t(10,10)
!$xmp distribute t( * ,block) onto p
2.4 align Directive
The align directive specifies that an array is to be mapped in the same way as a
specified template. In other words, an align directive defines the correspondence
of elements between an array and a template, and each of the array element is
allocated on the node where the corresponding template element is assigned.
p[0], p(1)
a[i] / a(i)
t[i] / t(i)
p[1], p(2)
p[2], p(3)
p[3], p(4)
Fig. 15 Example of array alignment (1)
p[0][0], p(1,1)
p[0][1], p(2,1)
p[1][0], p(1,2)
p[1][1], p(2,2)
a[i][j] / a(j,i)
t[i][j] / t(j,i)
Fig. 16 Example of array alignment (2)
19
XcalableMP C
#pragma xmp nodes p[4]
#pragma xmp template t[10][10]
#pragma xmp distribute t[block][ * ] onto p
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t(10,10)
!$xmp distribute t( * ,block) onto p
2.4 align Directive
The align directive specifies that an array is to be mapped in the same way as a
specified template. In other words, an align directive defines the correspondence
of elements between an array and a template, and each of the array element is
allocated on the node where the corresponding template element is assigned.
p[0], p(1)
a[i] / a(i)
t[i] / t(i)
p[1], p(2)
p[2], p(3)
p[3], p(4)
Fig. 15 Example of array alignment (1)
p[0][0], p(1,1)
p[0][1], p(2,1)
p[1][0], p(1,2)
p[1][1], p(2,2)
a[i][j] / a(j,i)
t[i][j] / t(j,i)
Fig. 16 Example of array alignment (2)
