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
) 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.)
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 to is ALIGN alignee align-directive-stuff
realign-directive -to -rule
to to is REALIGN alignee align-directive-stuff
-to or REALIGN align-attribute-stuff :: alignee-list
align-directive-stuff -to -rule
to to is ( align-source-list ) align-with-clause
align-attribute-stuff -to -rule
to to is [ ( align-source-list ) ] align-with-clause
alignee -to -rule
to to is object-name
align-source -to -rule
to to is :
-to or *
-to or align-dummy
align-dummy -to -rule
to to is scalar-int-variable
XBNF
Note that the possibility of an ALIGN directive of the form
_=13_}
Next: DYNAMIC Directive
Up: Data Alignment and
Previous: DISTRIBUTE and REDISTRIBUTE