XcalableACC: An Integration of XcalableMP and OpenACC
125
Template
Node #0
Host
Accelerator
Node #1
OpenACC
XcalableACC
XcalableMP
Fig. 2 Concept of XMP extensions
directives declare distributed arrays, parallelize loop statements, and transfer data
among host memories according to the distributed template. OpenACC directives
transfer the distributed arrays between host memory and accelerator memory on
the same node and execute the loop statements parallelized by XMP on accelerators
in parallel. XACC directives, which are XMP communication directives with an
acc clause, transfer data among accelerator memories and between accelerator
memory and host memory on different nodes. Moreover, coarray features also
transfer data on different nodes.
Note that the XMP extensions are not a simple combination of XMP and
OpenACC. For example, if you represent communication of distributed array
among accelerators shown in Fig. 2 by the combination of XMP and OpenACC,
you need to specify explicitly communication between host and accelerator by
OpenACC and that between hosts by XMP. Moreover, you need to calculate
manually indices of the distributed array owned by each node. By contrast, XACC
directives can represent such communication among accelerators directly using
global indices.
1.2.2 OpenACC Extensions
The OpenACC extension can represent offloading works and data to multipleaccelerators on a node. Figure 3 shows a concept of the OpenACC extension.
OpenACC extension directive defines a device set. The device set represents a
set of devices on a node. Futher, OpenACC extension directives declare distributed
arrays on the device set while maintaining the arrays on the host memory, and
the directives distribute offloading loop statement and memory copy between host
and device memories for the distributed-arrays. Moreover, OpenACC extension
directives synchronize devices among the device set. XACC directives also transfer
data between device memories on the node.
125
Template
Node #0
Host
Accelerator
Node #1
OpenACC
XcalableACC
XcalableMP
Fig. 2 Concept of XMP extensions
directives declare distributed arrays, parallelize loop statements, and transfer data
among host memories according to the distributed template. OpenACC directives
transfer the distributed arrays between host memory and accelerator memory on
the same node and execute the loop statements parallelized by XMP on accelerators
in parallel. XACC directives, which are XMP communication directives with an
acc clause, transfer data among accelerator memories and between accelerator
memory and host memory on different nodes. Moreover, coarray features also
transfer data on different nodes.
Note that the XMP extensions are not a simple combination of XMP and
OpenACC. For example, if you represent communication of distributed array
among accelerators shown in Fig. 2 by the combination of XMP and OpenACC,
you need to specify explicitly communication between host and accelerator by
OpenACC and that between hosts by XMP. Moreover, you need to calculate
manually indices of the distributed array owned by each node. By contrast, XACC
directives can represent such communication among accelerators directly using
global indices.
1.2.2 OpenACC Extensions
The OpenACC extension can represent offloading works and data to multipleaccelerators on a node. Figure 3 shows a concept of the OpenACC extension.
OpenACC extension directive defines a device set. The device set represents a
set of devices on a node. Futher, OpenACC extension directives declare distributed
arrays on the device set while maintaining the arrays on the host memory, and
the directives distribute offloading loop statement and memory copy between host
and device memories for the distributed-arrays. Moreover, OpenACC extension
directives synchronize devices among the device set. XACC directives also transfer
data between device memories on the node.
