next up previous contents
Next: Example Up: Alignment Previous: Examples

Descriptive ALIGN Directives

The presence or absence of an asterisk at the start of an align-spec has the same meaning as in a dist-format-clause: it specifies whether the ALIGN directive is descriptive or prescriptive, respectively.

If an align-spec that does not begin with * is applied to a dummy argument, the meaning is that the dummy argument will be forced to have the specified alignment on entry to the subprogram. This may require (the implementation of) either the caller or the subprogram to temporarily remap the data of the actual argument or a copy thereof.

Note that a dummy argument may also be used as an align-target.

      SUBROUTINE NICHOLAS(TSAR,CZAR)
      REAL, DIMENSION(1918) :: TSAR,CZAR
!HPF$ INHERIT :: TSAR
!HPF$ ALIGN WITH TSAR :: CZAR

In this example the first dummy argument, TSAR, remains aligned with the corresponding actual argument, while the second dummy argument, CZAR, is forced to be aligned with the first dummy argument. If the two actual arguments are already aligned, no remapping of the data will be required at run time. If they are not, some remapping will take place.

If the align-spec begins with ``*'', then the alignee must be a dummy argument. The ``*'' indicates that the programmer believes that the actual argument already has the specified alignment, and that no action to remap it is required at run time. (As before, there is no requirement that the programmer's belief is correct, and the compiler must generate a remapping if one appears to be necessary, just as in the case of a prescriptive alignment.) For example, if in the above example the alignment directive were changed to

!HPF$ ALIGN WITH *TSAR :: CZAR

then the programmer is expressing a belief that no remapping of the actual argument corresponding to TSAR will be necessary.

It is not permitted to say simply ``ALIGN WITH *''; an align-target must follow the asterisk. (The proper way to say ``accept any alignment'' is INHERIT.)

If a dummy argument has no explicit ALIGN or DISTRIBUTE attribute, then the compiler provides an implicit alignment and distribution specification, one that could have been described explicitly without any ``assertion asterisks''.




next up previous contents
Next: Example Up: Alignment Previous: Examples