Specification directives in HPF have two forms: specification statements, analogous to the DIMENSION and ALLOCATABLE statements of Fortran 90; and an attribute form analogous to type declaration statements in Fortran 90 using the ``::'' punctuation.
The attribute form allows more than one attribute to be described in a single directive. HPF goes beyond Fortran 90 in not requiring that the first attribute, or indeed any of them, be a type specifier.
For syntactic convenience, the executable directives REALIGN and REDISTRIBUTE also come in two forms (statement form and attribute form) but may not be combined with other attributes in a single directive.
H301 combined-directive is combined-attribute-list :: entity-decl-list H302 combined-attribute is ALIGN align-attribute-stuff or DISTRIBUTE dist-attribute-stuff or DYNAMIC or INHERIT or TEMPLATE or PROCESSORS or DIMENSION ( explicit-shape-spec-list ) Constraint: The same combined-attribute must not appear more than once in a given combined-directive. Constraint: If the DIMENSION attribute appears in a combined-directive, any entity to which it applies must be declared with the HPF TEMPLATE or PROCESSORS type specifier.The following rules constrain the declaration of various attributes, whether in separate directives or in a combined-directive.
If the DISTRIBUTE attribute is present, then every name declared in the entity-decl-list is considered to be a distributee and is subject to the constraints listed in section 3.3. If the ALIGN attribute is present, then every name declared in the entity-decl-list is considered to be an alignee and is subject to the constraints listed in section 3.4.
The HPF keywords PROCESSORS and TEMPLATE play the role of type specifiers in declaring processor arrangements and templates. The HPF keywords ALIGN, DISTRIBUTE, DYNAMIC, and INHERIT play the role of attributes. Attributes referring to processor arrangements, to templates, or to entities with other types (such as REAL) may be combined in an HPF directive without having the type specifier appear.
No entity may be given a particular attribute more than once.
Dimension information may be specified after an object-name or in a DIMENSION attribute. If both are present, the one after the object-name overrides the DIMENSION attribute (this is consistent with the Fortran 90 standard). For example, in:
!HPF$ TEMPLATE,DIMENSION(64,64) :: A,B,C(32,32),DA, B, and D are 64 X 64 templates; C is 32 X 32.
If a specification expression includes a reference to the value of an element of an array specified in the same specification-part, any explicit mapping or INHERIT attribute for the array must be completely specified in prior specification-directives. (This restriction is inspired by and extends section 22.214.171.124 of the Fortran 90 standard, which states in part: If a specification expression includes a reference to the value of an element of an array specified in the same specification-part, the array bounds must be specified in a prior declaration.
A comment on asterisks: The asterisk character ``*'' appears in the syntax rules for HPF alignment and distribution directives in three distinct roles: