next up previous contents
Next: Access to TypesProcedures, Up: Extrinsic Program Units Previous: The EXTRINSIC Prefix

Calling HPF Extrinsic Subprograms

A call to an extrinsic procedure behaves, as observed by a calling program coded in HPF, exactly as if the subprogram were coded in HPF. If a function or subroutine called from a program unit of an HPF extrinsic kind does not have an explicit interface visible in the caller, it is assumed to have the same extrinsic kind as the caller.

In order to call a subprogram of an extrinsic kind other than that of the caller, that subprogram must have an explicit interface visible in the caller, and the subprogram is expected to behave, as observed by the caller, roughly as if it had been written as code of the same extrinsic kind as the caller. Some of the responsibility for meeting this requirement may rest on the compiler and some on the programmer. This interface defines the ``HPF view'' of the extrinsic procedure.

A called procedure that is written in a model or language other than HPF, whether or not it uses the local procedure execution model, should be declared EXTRINSIC within an HPF program that calls it. The EXTRINSIC prefix declares what sort of interface should be used when calling indicated subprograms. If there is no extrinsic specification, then the users must assume full responsibility for correctness of the implementation-dependent interface.

A function-stmt or subroutine-stmt that appears within an interface-block within a program unit of an HPF extrinsic kind may have an extrinsic prefix mentioning any extrinsic kind supported by the language implementation. If no extrinsic-prefix appears in such a function-stmt or subroutine-stmt, then it is assumed to be of the same HPF extrinsic kind as the program unit in which the interface block appears.

The procedure characteristics defined by an interface-body must be consistent with the procedure's definition.

The definition and rules for a procedure with an extrinsic interface lies outside the scope of HPF. However, explicit interfaces to such procedures must conform to HPF. Note that any particular HPF implementation is free to support any selection of extrinsic kinds, or none at all except for HPF itself, which clearly must be supported by an HPF implementation.




next up previous contents
Next: Access to TypesProcedures, Up: Extrinsic Program Units Previous: The EXTRINSIC Prefix