Subject: Re: group 1 meeting

From: Rob Schreiber <[email-masked]>
Date: Wed, 29 Apr 92 11:06:06 PDT

Email is a good idea.

Barry's paper made the assumption that a pointer can or should
be distributed and that redistribution of the pointer redistributes the
data it points to.   Also, he proposed distributing an unassociated pointer
and then allocating storage that it points to, with inheritance of the
distribution from the pointer to the newly allocated storage.

I dont like the idea of distributing and array through a pointer to it.  Also,
what happens if the pointer is pointing to a subarray?

Proposal 1:    Pointers not allowed in distribution or alignment.
Target are allowed.   If a pointer points at a target or subarray of a target,
it gets the distribution that the target has.   IF THE TARGET's distribution changes,
then so does the pointer's.   (This requires a fancy implementation of pointers
to redistributable targets.)

Note that this does not allow explicit distribution of the storage allocated
by ALLOCATE using a pointer variable.

End of proposal.

   If that's too restrictive:

Proposal 2:   Just like Proposal 1, except that

Pointers are allowed in alignment and distribution directives, only if
they point at allocated storage, never if they are pointing to a target array.

End of proposal.

   Is something like this workable?

---

From: [email-masked]
Date: Thu, 30 Apr 92 10:46:11 -0400

How important will the use of pointers to explicitly mapped arrays be to
High Performance Fortran users?  I can think of a number of reasons why
it might not be so important:

 1. Pointers are a new feature in Fortran 90 that was not present in
    FORTRAN 77, so FORTRAN 77 users are probably not accustomed to using
    (at least) Fortran 90 pointers.

 2. Fortran 90 has other features, such as allocatable arrays, array sections,
    and explicit array reshaping operators, which take over many of the uses
    of the FORTRAN 77 pointer extensions, such as Cray pointers, without
    requiring the use of Fortran 90 pointers.

 3. Probably the most useful application of pointers that does not fall into
    any of the categories listed above is the use of pointers to derived-type
    objects (structures), to make linked data structures of various kinds.
    But it is already impossible to specify a mapping for structures because
    they aren't arrays.

When we put together the Digital proposal that was presented at the January
HPFF meeting, we stipulated that no explicit mapping could be specified either
for pointers or for objects declared with the TARGET attribute.  I think this
is more draconian than either of your models 1 or 2.  We did this because of
some of the implementation concerns that you raise, and because we felt we
were lacking a strong model of what the real needs of users would be in
specifying mappings for pointers or their targets.

I still believe in our model and would like to put it forward for serious
consideration.  It will be much easier to add the ability to specify mappings
for pointers and targets to a later version of HPF than it will be to take
away or revise a mapping capability that we define now and later become
unhappy with.

To change my mind about this, I would want to see a combination of the
following two:

 a. Some examples from real application practice in which an inability to
    specify pointers to explicitly mapped arrays will create a significant
    problem.

 b. A theory about how a proposed solution to the problems in (a) can be
    implemented without imposing considerable costs on "simple" uses of
    pointers.

Frankly, I suspect that pointers to explicitly mapped arrays should go fairly
far down on the priority list of things that HPF needs to support in order
to be useful, so I think we should beware of falling into a rathole about it.
But that's mostly because I haven't seen any examples of the type described
in (a) above.  I'd be happy to be educated on this point by some feedback from
real users.						-Bert Halstead