Next: Argument Association Up: Local Routines Written Previous: Local Routines Written
There are some restrictions on what HPF features may be used in writing a local, per-processor procedure.
A local HPF program unit may invoke other local program units or internal procedures, but it may not invoke an ordinary, ``global'' HPF routine. If a global HPF program calls local subprogram A with an actual array argument X, and A receives a portion of array X as dummy argument P, then A may call another local subprogram B and pass P or a section of P as an actual argument to B.
A local HPF program unit may not access global HPF data other than data that is accessible, either directly or indirectly, via the actual arguments. In particular, a local HPF program unit does not have access to global HPF COMMON blocks; COMMON blocks appearing in local HPF program units are not identified with global HPF COMMON blocks. The same name may not be used to identify a COMMON block both within a local HPF program unit and an HPF program unit in the same executable program.
Local program units can use all HPF constructs except for DISTRIBUTE, REDISTRIBUTE, ALIGN, REALIGN, and INHERIT directives. The distribution query library subroutines HPF_- ALIGNMENT, HPF_TEMPLATE, and HPF_DISTRIBUTION may be applied to local arrays. Their outcome is the same as for a global array that happens to have all its elements on a single node.
Scalar dummy arguments must be mapped so that each processor has a copy of the argument. This holds true, by convention, if no mapping is specified for the argument in the interface. Thus, the constraint disallows only explicit alignment and distribution directives in an explicit interface that imply that a scalar dummy argument is not replicated on all processors.
An EXTRINSIC(HPF_LOCAL) routine may not be RECURSIVE.
An EXTRINSIC(HPF_LOCAL) routine may not have alternate returns.
An EXTRINSIC(HPF_LOCAL) routine may not be invoked, either directly or indirectly, in the body of a FORALL construct or in the body of an INDEPENDENT loop.
The attributes (type, kind, rank, optional, intent) of the dummy arguments must match the attributes of the corresponding dummy arguments in the explicit interface. A dummy argument of an EXTRINSIC(HPF_LOCAL) routine may not be a procedure name.
A dummy argument of an EXTRINSIC(HPF_LOCAL) routine may not have the POINTER attribute.
A dummy argument of an EXTRINSIC(HPF_LOCAL) routine must be nonsequential.
A dummy array argument of an EXTRINSIC(HPF_LOCAL) routine must have assumed shape, even when it is explicit shape in the interface. Note that, in general, the shape of a dummy array argument differs from the shape of the corresponding actual argument, unless there is a single executing processor.
Explicit mapping directives for dummy arguments and function result variables may not appear in a local procedure, although they may appear (in the case of the result of an array-valued function, they must appear) in the required explicit interface accessible to the caller.
A local procedure may have several ENTRY points. A global HPF caller must contain a separate extrinsic interface for each entry point that can be invoked from the HPF program.