62
H. Murai et al.
5 Local-View Programming
5.1 Introduction
The programmer can use coarrays to specify one-sided communication in the localview model.
Depending on the environment, such one-sided communication might achieve
better performance than global communication in the global-view model. However,
it is more difficult and complicated to write parallel programs in the local-view
model because the programmer must specify every detail of parallelization, such as
data mapping, work mapping, and communication.
The coarray feature in XMP/Fortran is upward-compatible with that in Fortran
2008; that in XMP/C is defined as an extension to the base language.
An execution entity in local-view XMP programs is referred to as an “image”
while a node in global-view ones. These two words have almost the same meaning
in XMP.
5.2 Coarray Declaration
XcalableMP C
int a[10]:[ * ];
XcalableMP Fortran
integer a(10)[ * ]
In XMP/C, the programmer declares a coarray by adding “:[ * ]” after the array
declaration. In XMP/Fortran, the programmer declares a coarray by adding “[ * ]”
after the array declaration.
Note Based on Fortran 2008, coarrays should have the same size among all images.
Coarrays can be accessed in expressions by remote images as well as the local
images.
5.3 Put Communication
When a coarray appears in the left-hand side of an assignment statement, it involves
put communication.
Précédent

- 70/265

Suivant