52
H. Murai et al.
on p[0]. Similarly, in XMP/Fortran, b(1:2,1) on p(1), b(3:4,1) of p(2),
b(5:6,1) on p(3) and b(7:8,1) on p(4) are copied to a(:,1) on p(1).
4.2.2 In Mode
The right-hand side data of the assignment, all or part of which may reside outside
the executing node set, can be transferred from its owner nodes to the executing
nodes with an in gmove.
XcalableMP C
#pragma xmp nodes p[4]
#pragma xmp template t[4]
#pragma xmp distribute t[block] onto p
double a[4], b[4];
5 #pragma xmp align a[i] with t[i]
#pragma xmp align b[i] with t[i]
:
#pragma xmp task on p[0:2]
#pragma xmp gmove in
10
a[0:2] = b[2:2]
#pragma xmp end task
XcalableMP Fortran
!$xmp nodes p(4)
!$xmp template t(4)
!$xmp distribute t(block) onto p
real :: a(4), b(4)
5 !$xmp align a(i) with t(i)
!$xmp align b(i) with t(i)
:
!$xmp task on p(1:2)
!$xmp gmove in
10
a(1:2) = b(3:4)
!$xmp end task
In this example, the task directive divides four nodes into two sets, the first-half
and the second-half. A gmove construct that is in an in mode copies data using a
get operation from the second-half node to the first-half node (Fig. 40).
4.2.3 Out Mode
For the left-hand side data of the assignment, all or part of which may reside outside
the executing node set, the corresponding elements can be transferred from the
executing nodes to its owner nodes with an out gmove construct.
Précédent

- 60/265

Suivant