Next: DYNAMIC Directive
Up: Data Alignment and
Previous: DISTRIBUTE and REDISTRIBUTE
The ALIGN directive is used to specify that certain data objects are to be mapped in the same way as certain other data objects. Operations between aligned data objects are likely to be more efficient than operations between data objects that are not known to be aligned (because two objects that are aligned are intended to be mapped to the same abstract processor). The ALIGN directive is designed to make it particularly easy to specify explicit mappings for all the elements of an array at once. While objects can be aligned in some cases through careful use of matching DISTRIBUTE directives, ALIGN is more general and frequently more convenient.
The REALIGN directive is similar to the ALIGN directive but
is considered executable. An array (or template) may be realigned at
any time, provided it has been declared DYNAMIC (see Section
The ALIGN directive may appear only in the specification-part of a scoping unit. The REALIGN directive is
similar but may appear only in the execution-part of a scoping
unit. The principal difference between ALIGN and REALIGN
is that ALIGN must contain only a specification-expr as a
subscript or in a subscript-triplet, whereas in REALIGN such subscripts may be any integer expressions. Another
difference is that ALIGN is an attribute, and so can be combined
with other attributes as part of a combined-directive, whereas
REALIGN is not an attribute (although a REALIGN statement
may be written in the style of attributed syntax, using ``::''
punctuation).
Formally, the syntax of ALIGN and REALIGN is as follows:
XBNF
align-directive -to -rule
to
realign-directive -to -rule
to
align-directive-stuff -to -rule
to
align-attribute-stuff -to -rule
to
alignee -to -rule
to
align-source -to -rule
to
align-dummy -to -rule
to
Note that the possibility of an ALIGN directive of the form
_=13_}
) Unlike redistribution (see Section
), realigning a data object does not cause any
other object to be remapped. (However, realignment of even a single
object, if it is large, could require a lot of computational and
communication effort at run time; the programmer must take care when
using this feature.)
to is ALIGN alignee align-directive-stuff
to is REALIGN alignee align-directive-stuff
-to or REALIGN align-attribute-stuff :: alignee-list
to is ( align-source-list ) align-with-clause
to is [ ( align-source-list ) ] align-with-clause
to is object-name
to is :
-to or *
-to or align-dummy
to is scalar-int-variable
XBNF
).
Next: DYNAMIC Directive
Up: Data Alignment and Previous: DISTRIBUTE and REDISTRIBUTE