XcalableMP Programming Model and Language
17
XMP/C
XMP/Fortran
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
p[0], p(1)
p[1], p(2)
p[2], p(3)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Fig. 11 Gblock distribution
The programmer can specify an asterisk instead of a mapping array in the
gblock distribution to defer fixing the actual distribution. In such a case, the actual
distribution will be fixed at runtime by using the template_fix construct.
2.3.5 Distribution of Multi-Dimensional Templates
The programmer can distribute a multi-dimensional template onto a node array.
XcalableMP C
#pragma xmp nodes p[2][2]
#pragma xmp template t[10][10]
#pragma xmp distribute t[block][block] onto p
XcalableMP Fortran
!$xmp nodes p(2,2)
!$xmp template t(10,10)
!$xmp distribute t(block,block) onto p
The distribute directive declares the distribution of a two-dimensional
template t onto a two-dimensional node array p. Each dimension of the template
is divided in a block manner and each of the rectangular region is assigned to a node
(Fig. 12).
The programmer can specify a different distribution format in each of the
dimension of a template (Fig. 13).
XcalableMP C
#pragma xmp nodes p[2][2]
#pragma xmp template t[10][10]
#pragma xmp distribute t[block][cyclic] onto p
XcalableMP Fortran
!$xmp nodes p(2,2)
!$xmp template t(10,10)
!$xmp distribute t(cyclic,block) onto p
17
XMP/C
XMP/Fortran
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
p[0], p(1)
p[1], p(2)
p[2], p(3)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Fig. 11 Gblock distribution
The programmer can specify an asterisk instead of a mapping array in the
gblock distribution to defer fixing the actual distribution. In such a case, the actual
distribution will be fixed at runtime by using the template_fix construct.
2.3.5 Distribution of Multi-Dimensional Templates
The programmer can distribute a multi-dimensional template onto a node array.
XcalableMP C
#pragma xmp nodes p[2][2]
#pragma xmp template t[10][10]
#pragma xmp distribute t[block][block] onto p
XcalableMP Fortran
!$xmp nodes p(2,2)
!$xmp template t(10,10)
!$xmp distribute t(block,block) onto p
The distribute directive declares the distribution of a two-dimensional
template t onto a two-dimensional node array p. Each dimension of the template
is divided in a block manner and each of the rectangular region is assigned to a node
(Fig. 12).
The programmer can specify a different distribution format in each of the
dimension of a template (Fig. 13).
XcalableMP C
#pragma xmp nodes p[2][2]
#pragma xmp template t[10][10]
#pragma xmp distribute t[block][cyclic] onto p
XcalableMP Fortran
!$xmp nodes p(2,2)
!$xmp template t(10,10)
!$xmp distribute t(cyclic,block) onto p
