[ HPF Home | Versions | Compilers | Projects | Publications | Applications | Benchmarks | Events | Contact ] |
This introduction gives an overview of the ways in which mapping directives interact with argument passing to subprograms. The language used here, however, is not definitive; the subsequent subsections of this Section contain the authoritative rules.
In addition to the data mapping features described in Section 3, HPF allows a number of options for describing the mapping of dummy arguments.
The mapping of each such dummy argument may be related to the mapping of its associated actual argument in the calling main program or procedure (the ``caller'') in several different ways. To allow for this, mapping directives applied to dummy arguments can have three different syntactic forms: prescriptive, descriptive, and transcriptive.
HPF provides these three forms to allow the programmer either to specify that the data is to be left in place, or to specify that during the execution of the call the data must be automatically remapped into a new and presumably more efficient mapping for the duration of the execution of the called subprogram.
The meaning of these forms is as follows:
Prescriptive directives are syntactically identical to directives occurring elsewhere in the program. For instance, if A is a dummy argument,
is a prescriptive directive.!HPF$ DISTRIBUTE A (BLOCK, CYCLIC)
The assertion is characterized as "weak" because if it is false, the program is still standard-conforming. In such a case, the compiler must generate the appropriate remapping.
If the compiler can prove that the assertion is false, or if the compiler cannot verify that it is true, it may issue a warning or informational diagnostic message.
Descriptive directives look like prescriptive directives, except that an asterisk precedes the description. For instance,
is a descriptive directive.!HPF$ DISTRIBUTE A *(BLOCK, CYCLIC)
Transcriptive directives are written with a single asterisk for distributions and processor arrangements; for instance
!HPF$ DISTRIBUTE A * !HPF$ DISTRIBUTE B * ONTO *
are transcriptive directives. The INHERIT directive (see Section 4.4.2) is used to specify a transcriptive alignment.
Both distribution formats and processor arrangements can be specified prescriptively, descriptively, or transcriptively. Alignment is more complicated, because of the need to specify the template with which the dummy is aligned. This template may be unspecified (in this case of course there is no ALIGN directive), in which case it is the natural template of the dummy. (``Natural template'' is defined in Section 4.4.1 below.) Otherwise, one of the following disjoint possibilities must be true:
This is restated more precisely in Section 4.4.1 below.
While transcriptive mappings can be useful in writing libraries, they impose a run-time cost on the subprogram. They should therefore be avoided in normal user code. (End of advice to users.)
©2000-2006 Rice University | [ Contact Us | HiPerSoft | Computer Science ] |