XcalableMP Programming Model and Language
5
1.4 Programming Models
1.4.1 Partitioned Global Address Space
XMP can be classified as a partitioned global address space (PGAS) language, such
as Co-Array Fortran [1], Unified Parallel C [2], and Chapel [3].
In such PGAS languages, multiple executing entities (i.e. threads, processes, or
nodes in XMP) share a part of their address space, which is, however, partitioned
and a portion of which is local to each executing entity.
The two programming models, global-view and local-view, that XMP supports
to achieve high performance and productivity on PGAS are explained below.
1.4.2 Global-View Programming Model
The global-view programming model is useful when, starting from a serial version
of a program, the programmer parallelizes it in a data-parallel style by adding
directives with minimum modification. Based on this model, the programmer
specifies the distribution of data among nodes using the data distribution directives.
The loop construct assigns each iteration of a loop to the node at which the
computed data is located. The global-view communication directives are used to
synchronize nodes, maintain the consistency of shadow areas of distributed data,
and move sections of distributed data globally. Note that the programmer must
specify explicitly communication to make all data references in their program local
using appropriate directives.
In many cases, the XcalableMP program following the global-view programming
model is based on a serial program, and it can produce the same result, regardless
of the number of nodes (Fig. 4).
There are three groups of directives for this model:
• Data mapping, which specifies the data distribution and mapping to nodes
• Work mapping (parallelization), which specifies the work distribution and
mapping to nodes.
• Communication and synchronization, which specify how a node communicates
and synchronizes with the other nodes.
Because these directives are ignored as a comment by the compilers of base
languages (Fortran and C), an XcalableMP program can usually be compiled by
them to ensure that they run properly.
1.4.3 Local-View Programming Model
The local-view programming model is suitable for programs that implement an
algorithm and a remote data reference that are to be executed by each node (Fig. 5).
5
1.4 Programming Models
1.4.1 Partitioned Global Address Space
XMP can be classified as a partitioned global address space (PGAS) language, such
as Co-Array Fortran [1], Unified Parallel C [2], and Chapel [3].
In such PGAS languages, multiple executing entities (i.e. threads, processes, or
nodes in XMP) share a part of their address space, which is, however, partitioned
and a portion of which is local to each executing entity.
The two programming models, global-view and local-view, that XMP supports
to achieve high performance and productivity on PGAS are explained below.
1.4.2 Global-View Programming Model
The global-view programming model is useful when, starting from a serial version
of a program, the programmer parallelizes it in a data-parallel style by adding
directives with minimum modification. Based on this model, the programmer
specifies the distribution of data among nodes using the data distribution directives.
The loop construct assigns each iteration of a loop to the node at which the
computed data is located. The global-view communication directives are used to
synchronize nodes, maintain the consistency of shadow areas of distributed data,
and move sections of distributed data globally. Note that the programmer must
specify explicitly communication to make all data references in their program local
using appropriate directives.
In many cases, the XcalableMP program following the global-view programming
model is based on a serial program, and it can produce the same result, regardless
of the number of nodes (Fig. 4).
There are three groups of directives for this model:
• Data mapping, which specifies the data distribution and mapping to nodes
• Work mapping (parallelization), which specifies the work distribution and
mapping to nodes.
• Communication and synchronization, which specify how a node communicates
and synchronizes with the other nodes.
Because these directives are ignored as a comment by the compilers of base
languages (Fortran and C), an XcalableMP program can usually be compiled by
them to ensure that they run properly.
1.4.3 Local-View Programming Model
The local-view programming model is suitable for programs that implement an
algorithm and a remote data reference that are to be executed by each node (Fig. 5).
