XcalableMP Programming Model and Language
15
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. 9 Cyclic distribution
2.3.2 Cyclic Distribution
XcalableMP C
#pragma xmp distribute t[cyclic] onto p
XcalableMP Fortran
!$xmp distribute t(cyclic) onto p
The target template t is divided into chunks of size one and distributed among
nodes in the node array p in a round-robin manner (Fig. 9). The cyclic distribution
is useful for the case where the load on each element of the template is not balanced.
XcalableMP C
#pragma xmp nodes p[3]
#pragma xmp template t[22]
#pragma xmp distribute t[cyclic] onto p
XcalableMP Fortran
!$xmp nodes p(3)
!$xmp template t(22)
!$xmp distribute t(cyclic) onto p
2.3.3 Block-Cyclic Distribution
XcalableMP C
#pragma xmp distribute t[cyclic(w)] onto p
XcalableMP Fortran
!$xmp distribute t(cyclic(w)) onto p
The target template t is divided into chunks of size w and distributed among
nodes in the node array p in a round-robin manner (Fig. 10). The block-cyclic
distribution is useful for the case where the load on each element of the template is
not balanced but the locality of the elements is required.
Précédent

- 23/265

Suivant