60
H. Murai et al.
Hint Asynchronous communication can be overlapped with the following computation to hide its overhead.
Note Expressions that can be specified as tags in the async clause are of type int,
in XMP/C, or integer, in XMP/Fortran.
4.7 reduce_shadow Construct
The reduce_shadow directive adds the value of a shadow object to the corresponding data object of the array.
XcalableMP C
#pragma xmp nodes p[2]
#pragma xmp template t[8]
#pragma xmp distribute t[block] onto p
int a[8];
5 #pragma xmp align a[i] with t[i]
#pragma xmp shadow a[1]
:
#pragma xmp loop on t[i]
for(int i=0;i<8;i++)
10
a[i] = i+1;
#pragma xmp reflect (a)
#pragma xmp reduce_shadow (a)
XcalableMP Fortran
!$xmp nodes p(2)
!$xmp template t(8)
!$xmp distribute t(block) onto p
integer a(8)
5 !$xmp align a(i) with t(i)
!$xmp shadow a(1)
!$xmp loop on t(i)
do i=1, 8
10
a(i) = i
enddo
!$xmp reflect (a)
!$xmp reduce_shadow (a)
H. Murai et al.
Hint Asynchronous communication can be overlapped with the following computation to hide its overhead.
Note Expressions that can be specified as tags in the async clause are of type int,
in XMP/C, or integer, in XMP/Fortran.
4.7 reduce_shadow Construct
The reduce_shadow directive adds the value of a shadow object to the corresponding data object of the array.
XcalableMP C
#pragma xmp nodes p[2]
#pragma xmp template t[8]
#pragma xmp distribute t[block] onto p
int a[8];
5 #pragma xmp align a[i] with t[i]
#pragma xmp shadow a[1]
:
#pragma xmp loop on t[i]
for(int i=0;i<8;i++)
10
a[i] = i+1;
#pragma xmp reflect (a)
#pragma xmp reduce_shadow (a)
XcalableMP Fortran
!$xmp nodes p(2)
!$xmp template t(8)
!$xmp distribute t(block) onto p
integer a(8)
5 !$xmp align a(i) with t(i)
!$xmp shadow a(1)
!$xmp loop on t(i)
do i=1, 8
10
a(i) = i
enddo
!$xmp reflect (a)
!$xmp reduce_shadow (a)
