Specification directives in HPF have two forms: specification statements, analogous to the DIMENSION and ALLOCATABLE statements of Fortran; and an attribute form analogous to type declaration statements in Fortran using the ``::'' punctuation.
The attribute form allows more than one attribute to be described in a single directive. HPF goes beyond Fortran in not requiring that the first attribute, or indeed any of them, be a type specifier.
|H301combined-directive||is combined-attribute-list :: combined-decl-list|
is ALIGN align-attribute-stuff|
or DISTRIBUTE dist-attribute-stuff
or DIMENSION ( explicit-shape-spec-list )
is hpf-entity [ ( explicit-shape-spec-list ) ]|
The INHERIT attribute is related to subroutine call conventions and will be discussed in Section 4.
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 combined-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, 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 hpf-entity 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 standard). For example, in:
!HPF TEMPLATE,DIMENSION(64,64) :: A,B,C(32,32),D
A, B, and D are templates; C is .
Directives mapping a variable must be in the same scoping unit where the variable is declared.
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 F95:22.214.171.124 in the Fortran 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:
the approved extensions (see section 8.8).
An asterisk can also be used in the PASS_BY attribute in an interface block to describe dummy arguments passed by reference to an extrinsic routine written in C (see Section 11.2).