Subject: hpff-core: Directives in Procedure Interfaces

From: [email-masked] (Carl Offner)
Date: Fri, 27 Oct 1995 13:12:03 -0500 (CDT)

---------------------------------------------------------------------------
[email-masked] is a mailing list for announcements related to High
Performance Fortran.  Instructions for adding or deleting yourself
from this list appear at the bottom of this message.
---------------------------------------------------------------------------

[Carl sent this message 10/23/95, when Majordomo was experiencing a nervous
breakdown.  I'm forwarding it now that things appear to be working again. -
chk]

Based on the discussion at the last meeting, I have consulted with
a few people and revised the proposal on directives in procedure
interfaces.  Here is the new proposal; I will write this up
in more detail for the November meeting.  If anyone has comments
at this stage, I would certainly appreciate hearing them.

                --Carl Offner
                [email-masked]

--------------------------------------------------------------------
----------------------------------------------------------------------

An explicit interface is required in each of the following cases:

1.  A parameter is passed transcriptively or with the inherit
attribute.

2.  The mapping of a dummy argument is not the same as the mapping of
the corresponding actual argument, and at least one of the following
two conditions is true:

        a) the dummy argument is explicitly mapped;

        b) the actual argument is an explicitly mapped whole array or
           a section of an explicitly mapped array.

----------------------------------------------------------------------

Brief discussion:

I believe that this solves the problem of not breaking any vanilla
Fortran 90 code.  It is only the presence of HPF directives that would
force a new explicit interface to be present.  Providing such an
interface would be part of introducing directives in a routine, and
could most simply be accomplished by having the routine be part of a
module; this is certainly the idiomatic Fortran 90 way of doing things
anyway.

In addition, it addresses the three original purposes of this
proposal:

a) It brings the use of explicit interfaces more into the spirit of
the way Fortran 90 uses them.

b) It does not preclude a model in which the caller does any necessary
remapping.

c) It means that "kernel HPF" (or simply "HPF" now, I guess) will not
have a separate programming model; it will not need to be something
EXTRINSIC.

It has been pointed out that an actual array and its corresponding
dummy, both of which are not explicitly mapped, might have different
mappings.  While this is true, this proposal leaves it up to the
compiler to handle this case correctly; certainly a compiler can do
so.

In this connection, I have to disagree with the idea that a default
mapping is an invitation to the compiler to do something smart or
clever.  My view is that a default mapping tells the compiler it can
be stupid.  The compiler, after all, can always do something clever
anyway; and all the mapping directives are only advisory.  But to do
something really clever, the compiler will need to perform extensive
interprocedural analysis, and if it does so, there is hardly much need
for explicit interfaces anyway.

---------------------------------------------------------------------------
To (un)subscribe to this list, send mail to [email-masked].
Leave the subject line blank, and in the body put the line
(un)subscribe <email-address>
---------------------------------------------------------------------------