XcalableACC: An Integration of XcalableMP and OpenACC
131
Fig. 7 Code example in reflect construct
coarray and the host_data construct enables one-sided communication between
accelerators.
If coarrays appear in a use_device clause of an enclosing host_data construct, data on accelerator memory is selected as the target of the communication.
The synchronization for Coarray operations on accelerators is similar to that in
XMP.
Restriction
• Coarrays on accelerator memory can be declared only with the declare
directive.
• No coarray syntax is allowed in the OpenACC compute region.
Example
In line 3 of Fig. 8, the declare directive declares a coarray a and an array
b on accelerator memory. In lines 6–7, node 1 performs a put operation, where
the whole of b on the accelerator memory of node 1 is transferred to a on the
accelerator memory of node 2. In lines 9–10, node 1 performs a get operation,
where the whole of a on the accelerator memory of node 3 is transferred to b on
the host memory of node 1. In line 13, the sync all statement in XACC/F or the
xmp_sync_all function in XACC/C performs a barrier synchronization among
all nodes and guarantees the completion of ongoing coarray accesses.
2.5 Handling Multiple Accelerators
XACC also has a feature for handling multiple accelerators. This section provides a
brief overveiw of this feature. Please refer to [4] for more detail.
Précédent

- 138/265

Suivant