next up previous contents
Next: Examples of Extrinsic Procedures Up: Calling HPF Extrinsic Subprograms Previous: Data

The Effect of a Call

  A call to an extrinsic procedure must be semantically equivalent to a call of an ordinary HPF procedure that does not remap its arguments. Thus a call to an extrinsic procedure must behave as if the following actions occur. The HPF technical term as if means that the described actions should appear to a user as if they occurred, in the order specified; an implementation may carry out any actions in any order that provide the correct user-visible effects.

  1. All actions of the caller preceding the subprogram invocation should be completed before any action of the subprogram is executed; and all actions of the subprogram should be completed before any action of the caller following the subprogram invocation is executed.
  2. Each actual argument is remapped, if necessary, according to the directives (explicit or implicit) in the declared interface for the extrinsic procedure. Thus, HPF mapping directives appearing in the interface are binding--the compiler must obey these directives in calling local extrinsic procedures. As in the case of non-extrinsic subprograms, actual arguments may be mapped in any way; if necessary, they are copied automatically to correctly mapped temporaries before invocation of--and copied back to the actual arguments after return from--the extrinsic procedure. Scalar dummy arguments and scalar function results behave as if they are replicated on each processor. These mappings may, optionally, be explicit in the interface, but any other explicit mapping is not HPF conforming.
  3. IN, OUT, and INOUT intent restrictions should be observed.
  4. No HPF variable is modified unless it could be modified by an HPF procedure with the same explicit interface. Note that even though HPF_LOCAL and HPF_SERIAL routines are not permitted to access and modify HPF global data, other kinds of extrinsic routines may do so to the extent that an HPF procedure could.
  5. When a procedure returns and the caller resumes execution, all objects accessible to the caller after the call are mapped exactly as they were before the call. In particular, the original distribution of arguments is restored, if necessary.
  6. Exactly the same set of processors is visible to the HPF environment before and after the subprogram call.


next up previous contents
Next: Examples of Extrinsic Procedures Up: Calling HPF Extrinsic Subprograms Previous: Data