next up previous contents
Next: What Remapping Is Required Up: Data Mapping in Subprogram Interfaces Previous: Data Mapping in Subprogram Interfaces



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:

The directive describes the mapping of the dummy argument. However, the actual argument need not have this mapping. If it does not, it is the responsibility of the compiler to generate code to remap the argument as specified, and to restore the original mapping on exit. This code may be generated either in the caller or in the called subprogram; the requirements for explicit interfaces in Section 4.6 insure that the necessary information will be available at compile time to perform the mapping in either place.

Prescriptive directives are syntactically identical to directives occurring elsewhere in the program. For instance, if A is a dummy argument,

is a prescriptive directive.

Descriptive syntax has exactly the same meaning as prescriptive syntax, except that in addition it amounts to a weak assertion by the programmer that the actual arguent requires no remapping.

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.

The mapping is unspecified. The called subprogram must accept the mapping of the argument as it is passed. Of course this means that (the implementation of) the caller must pass this mapping information at run-time.

Transcriptive directives are written with a single asterisk for distributions and processor arrangements; for instance


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.

next up previous contents
Next: What Remapping Is Required Up: Data Mapping in Subprogram Interfaces Previous: Data Mapping in Subprogram Interfaces