Next:
Example 1 Up: High Performance Fortran Journal Previous: Rationale


EXECUTE-ON-HOME and LOCAL-ACCESS Directives

The EXECUTE-ON-HOME directive is used to suggest where an iteration of a DO construct or an indexed parallel assignment should be executed. The specified location of computation provides the reference with which the compiler determines which data access of the computation should be local and which data access may be remote. The LOCAL-ACCESS directive further asserts which data accesses are indeed local.

XBNF

execute-on-home-direct -to -rule to to is EXECUTE (align-source-list) ON_HOME align-spec [, local-access-directive]

local-access-directive -to -rule to to is LOCAL_ACCESS array-name-list

XBNF

The EXECUTE-ON-HOME directive must immediately precede the corresponding DO construct, array assignment, FORALL statement, FORALL construct or individual assignment statement in a FORALL construct.

The scope of an EXECUTE-ON-HOME directive is the entire loop body of the following DO construct, or the following array assignment, FORALL statement, FORALL construct or assignment statement in a FORALL construct.

When an EXECUTE-ON-HOME directive is applied to a DO construct, a FORALL statement, a FORALL construct or an assignment statement in a FORALL construct, the align-source-list identifies a distinct iteration index or an indexed parallel assignment in the corresponding scope and the align-spec identifies a template node. Every iteration index or indexed assignment must be associated with one and only one template node. The EXECUTE-ON-HOME directive states that each iteration or indexed parallel assignment should be executed on the processor where its associated template node is mapped. For any subroutine call within a DO construct, the EXECUTE-ON-HOME directive specifies only the execution location of the caller but not necessarily the execution location of the called subroutine.

When an EXECUTE-ON-HOME directive is applied to an array assignment statement, each align-source identifies positions spread along one dimension (:) or a collapsed dimension (*) of the assigned array, and the align-spec identifies the associated template or template section. (Replication, i.e. ``*'', is not allowed in align-spec.) The align-source-list must have the same rank as the assigned array. The associated template or template section must have the same size as the assigned array in all uncollapsed dimensions. The EXECUTE-ON-HOME directive states that, for each element in the assigned array, the corresponding evaluation and assignment should be executed on the processor where the corresponding template element of the associated template is mapped. For example,

!HPF EXECUTE (:,*) ON_HOME T(2:N) A(1:N-1,2:N) = B(2:N,1:N-1) A(1,j) = B(2,j-1) is executed on the processor to which T(2) is mapped, where j = 2,..,N.

(Align-spec in current HPF is restricted to simple expressions of align-dummy. Thus only regular data mapping is supported. If array elements or functions are allowed in align-spec for specifying irregular data mapping, the above EXECUTE-ON-HOME directive can also be used to address the corresponding computation location problem.)

EXECUTE-ON-HOME directives can be nested, but only the immediately preceding EXECUTE-ON-HOME directive is effective.

The optional LOCAL-ACCESS directive asserts that all data accesses to the specified array-name-list within the scope of the EXECUTE-ON-HOME directive can be handled as local data accesses if the related HPF data mapping directives are honored.

The LOCAL-ACCESS directive can also be used separately from the EXECUTE-ON-HOME directive. When used alone, it applies only to the immediately following statement or construct, and asserts that all specified data accesses are local data accesses provided that the immediately preceding EXECUTE-ON-HOME directive and all related HPF data mapping directives are honored. The assertion overrides any local-access assertions by the preceding EXECUTE-ON-HOME directive. It is an error when a LOCAL-ACCESS directive is not applied inside the scope of some EXECUTE-ON-HOME directive.

INDEPENDENT and EXECUTE-ON-HOME directives can be combined into a single HPF directive when they are applied to the same DO or FORALL construct,

XBNF

combined-assert-direct -to -rule to to is assertion-directive-list

assertion-directive -to -rule to to is independent-directive -to or execute-on-home-directive

XBNF




Next:
Example 1 Up: High Performance Fortran Journal Previous: Rationale

paula@erc.msstate.edu
Thu May 5 15:11:02 CDT 1994