XcalableMP Programming Model and Language
51
#pragma xmp distribute t[block] onto p
int a[16], b[16], c;
5
#pragma xmp align a[i] with t[i]
:
#pragma xmp gmove
a[9:5] = b[0:5];
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t(16)
!$xmp distribute t(block) onto p
integer :: a(16), b(16), c
5
!$xmp align a(i) with t(i)
:
!$xmp gmove
a(10:14) = b(1:5)
In this example, a replicated array b is locally copied to distributed array a
without communication.
XcalableMP C
#pragma xmp nodes p[4]
#pragma xmp template t1[4]
#pragma xmp template t2[8]
#pragma xmp distribute t1[block] onto p
5 #pragma xmp distribute t2[block] onto p
int a[4][8], b[4][8];
#pragma xmp align a[i][ * ] with t1[i]
#pragma xmp align b[ * ][i] with t2[i]
:
10 #pragma xmp gmove
a[0][:] = b[0][:];
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t1(4)
!$xmp template t2(8)
!$xmp distribute t1(block) onto p
5 !$xmp distribute t2(block) onto p
integer :: a(4,8), b(4,8)
!$xmp align a( * ,i) with t1(i)
!$xmp align b(i, * ) with t2(i)
:
10 #pragma xmp gmove
a(:,1) = b(:,1)
In this example (Fig. 39), in XMP/C, b[0][0:2] on p[0], b[0][2:2] of
p[1], b[0][4:2] on p[2] and b[0][6:2] on p[3] are copied to a[0][:]
51
#pragma xmp distribute t[block] onto p
int a[16], b[16], c;
5
#pragma xmp align a[i] with t[i]
:
#pragma xmp gmove
a[9:5] = b[0:5];
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t(16)
!$xmp distribute t(block) onto p
integer :: a(16), b(16), c
5
!$xmp align a(i) with t(i)
:
!$xmp gmove
a(10:14) = b(1:5)
In this example, a replicated array b is locally copied to distributed array a
without communication.
XcalableMP C
#pragma xmp nodes p[4]
#pragma xmp template t1[4]
#pragma xmp template t2[8]
#pragma xmp distribute t1[block] onto p
5 #pragma xmp distribute t2[block] onto p
int a[4][8], b[4][8];
#pragma xmp align a[i][ * ] with t1[i]
#pragma xmp align b[ * ][i] with t2[i]
:
10 #pragma xmp gmove
a[0][:] = b[0][:];
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t1(4)
!$xmp template t2(8)
!$xmp distribute t1(block) onto p
5 !$xmp distribute t2(block) onto p
integer :: a(4,8), b(4,8)
!$xmp align a( * ,i) with t1(i)
!$xmp align b(i, * ) with t2(i)
:
10 #pragma xmp gmove
a(:,1) = b(:,1)
In this example (Fig. 39), in XMP/C, b[0][0:2] on p[0], b[0][2:2] of
p[1], b[0][4:2] on p[2] and b[0][6:2] on p[3] are copied to a[0][:]
