Next:
Requirements on the Up: Extrinsic Procedures Previous: Overview


Definition and Invocation of Extrinsic Procedures

An explicit interface must be provided for each extrinsic procedure entry in the scope where it is called, using an interface block. This interface defines the ``HPF view'' of the extrinsic procedure. XBNF extrinsic-prefix -to -rule to to is EXTRINSIC ( extrinsic-kind-keyword )

extrinsic-kind-keyword -to -rule to to is HPF -to or HPF_LOCAL XBNF An extrinsic-prefix may appear in a subroutine-stmt or function-stmt (as defined in the Fortran 90 standard) in the same place that the keyword RECURSIVE might appear. See Section for the extended forms of the grammar rules for function-stmt and subroutine-stmt covering this case.

The extrinsic-kind-keyword indicates the kind of extrinsic interface to be used. (It may be helpful to think of this name as being to the subprogram calling interface what a KIND parameter is for a numeric type. However, an extrinsic-kind is not integer-valued; it is merely a keyword.) HPF defines two such keywords: HPF and HPF_LOCAL. The keyword HPF_LOCAL is intended for use in calling routines coded in the ``local HPF'' style described in Annex . The keyword HPF refers to the interface normally used for calling ordinary HPF routines. Thus writing EXTRINSIC(HPF) in an HPF program has exactly the same effect as not using an EXTRINSIC specifier at all.

A subprogram with an extrinsic interface lies outside the scope of HPF. However, explicit interfaces to such subprograms must conform to HPF. Note that any particular HPF implementation is free to support any selection of extrinsic kind keywords, or none at all except for HPF itself. Examples:

INTERFACE EXTRINSIC(HPF_LOCAL) FUNCTION BAGEL(X) REAL X(:) REAL BAGEL(100) !HPF ALIGN WITH X :: Y, Z !HPF DISTRIBUTE (BLOCK, BLOCK) X END FUNCTION END INTERFACE INTERFACE KNISH

FUNCTION RKNISH(X) !normal HPF interface REAL X(:), RKNISH END RKNISH

EXTRINSIC(SISAL) FUNCTION CKNISH(X) !extrinsic interface COMPLEX X(:), CKNISH END CKNISH

END INTERFACE In the last interface block, two external procedures, one of them extrinsic and one not, are associated with the same generic procedure name, which returns a scalar of the same type as its array argument.

The intent is that a call to an extrinsic subprogram behaves, as observed by a calling program coded in HPF, exactly as if the subprogram has been coded in HPF.



Next:
Requirements on the Up: Extrinsic Procedures Previous: Overview

paula@erc.msstate.edu
Thu Jul 21 17:05:43 CDT 1994