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 three such keywords:
HPF$, HPF_LOCAL, and HPF_SERIAL. 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.
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.
For example, an implementation on a parallel processor may find it
convenient to replicate scalar arguments so as to provide a copy
on every processor. This is permitted so long as this process
is invisible to the caller. One way to achieve this is to place
a restriction on the programmer:
on return from the subprogram, all the copies of this scalar argument
must have the same value. This implies that if
the dummy argument has INTENT(OUT), then all copies must have
been updated consistently by the time of subprogram return.
(End of advice to implementors.)
Next: Requirements on the
Up: Extrinsic Procedures
Previous: Overview