Subject: hpff-interpret: HPF distributed pointer arrays

From: David Singleton <[email-masked]>
Date: Fri, 2 Feb 1996 17:36:35 +1100 (EST)

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

Is there a contradiction within the HPF 1.1 Language Specification 
document with regards to distributed pointer arrays?

In section 3.3, page 27, line 5 (repeated in appendix C, page 186,
line 48), it is stated that a distributee in a DISTRIBUTE directive
may NOT have the POINTER attribute. However section 3.6, page 38, line
24, makes the contrary statement. The rest of section 3.6 clearly
suggests that pointer arrays are supposed to be distributable.

The negative statements where not in HPF Version 1.0. 

Can you clarify please?

Thanks,
David Singleton

----------------------------------------------------------------------------
Dr David Singleton               ANU Supercomputer Facility
[email-masked]       Australian National University   
Work Phone: +61 6 249 4389       Canberra, ACT, 0200, Australia
Home Phone: +61 6 248 7142       Fax: +61 6 279 8199
----------------------------------------------------------------------------

---------------------------------------------------------------------------
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>
---------------------------------------------------------------------------

---

From: <[email-masked]> (Henry Zongaro)
Date: Fri, 2 Feb 1996 09:01:36 -0500 (EST)

Hi David,

> suggests that pointer arrays are supposed to be distributable.

     Yes, there is a contradiction in the HPF 1.1 document.  The response to an
interpretation question posed was that pointers cannot appear as distributees
in a DISTRIBUTE directive.  Instead, a pointer acquires the mapping of its
associated target, if any.

     The instance you cite in section 3.6 was missed in the HPF 1.1 document,
but will be fixed in HPF 1.2.

Thanks,

Henry

---

From: David Singleton <[email-masked]>
Date: Sat, 3 Feb 1996 15:26:03 +1100 (EST)

Thanks for your prompt reply Henry.

It is reasonable that a pointer array has the distribution of its
associated target. However this does not cover the case when the
pointer array is allocated instead of pointer assigned to an existing
array. If pointers are removed from section 3.6 then the only
conclusion is that pointer arrays cannot be allocated as distributed
arrays. Is this correct?

If true, this seems highly and unnecessarily restrictive. If
allocatable and automatic arrays can be distributed, why not
dynamically allocated pointer arrays? The big advantage of allocated
pointer arrays is that they can be placed in the global namespace via
COMMON or modules. The Fortran90 and HPF constraints on nonsequential
COMMON blocks should be sufficient to include distributed pointer
arrays.

Not allowing pointer arrays as distributees or alignees also
eliminates the possibility of REDISTRIBUTING or REALIGNING them after
allocation as well.

Even without having pointer arrays, CMFortran successfully encompassed
dynamic allocation of distributed arrays albeit by actually giving the
user access to array descriptors. Fortran90 pointer arrays should only
simplify the user interface to such dynamic allocation.

I would be very interested to understand the HPFF stance on allocated
distributed pointer arrays - it doesn't appear to be addressed in HPF2
documents. If you can point me at any other relevant online
documents, I'd be wery appreciative.

Thanks for your help and time,
David Singleton

---

From: <[email-masked]> (Henry Zongaro)
Date: Mon, 5 Feb 1996 20:48:21 -0500 (EST)

Hi David,

> conclusion is that pointer arrays cannot be allocated as distributed

That's correct; a pointer appearing in an ALLOCATE statement would get some
compiler default distribution (probably replication).

> eliminates the possibility of REDISTRIBUTING or REALIGNING them after

The original interpretation request that prompted this restriction asked
whether the following was a valid program - could a pointer be given one
mapping and made to point at something with a different mapping.

           program p
             integer, pointer :: ptr(:)
             integer, target :: targ(100)
    !hpf$    processors proc(number_of_processors())
    !hpf$    distribute targ(cyclic) onto proc
    !hpf$    distribute ptr(block) onto proc

             ptr => targ
           end program p

HPFF decided that it would be best to avoid such problems by prohibiting the
pointer from having an explicit mapping, and having it acquire the mapping of
its target.  This (perhaps inadvertently - I'm not sure) had the effect of
preventing the user from explicitly mapping pointers when they become
associated through the ALLOCATE statement.

> documents, I'd be wery appreciative.

This issue was raised by Larry Meadows for HPF 2.0, but I'm not sure off-hand
how it was dealt with at the last HPFF meeting.  Does anyone recall whether
this aspect of the problem came up for discussion?

Thanks,

Henry

---

From: Carol Munroe <[email-masked]>
Date: Tue, 6 Feb 96 10:27:46 EST

From: <[email-masked]> (Henry Zongaro)
   Date: Mon, 5 Feb 1996 20:48:21 -0500 (EST)

   Hi David,

	      program p

		ptr => targ
	      end program p

I only recall that this came up at the vendors subgroup, where we proposed
that DISTRIBUTE and ALIGN be reallowed for POINTER and ALLOCATABLE
variables for precisely this reason. The idea, as I understood it, was to
let POINTER arrays be mapped, but only (in the absence of DYNAMIC) allow
them to point to similarly mapped variables. (I don't think we talked about
the question of pointing at array sections of similarly mapped variables.)
I'm not sure what the last official HPFF vote on pointers was, although I
believe it implied that nondynamic pointer arrays should only point to
things with the same mapping, which seems to me most compatible with their
having a mapping themselves, not with their having no mapping.

   Thanks,

   Henry