Subject: Parallel pointer processing

From: Guy Steele <[email-masked]>
Date: Tue, 28 Jul 92 15:24:20 EDT

Proposal A:  Pointer assignments may appear in the body of a FORALL.
	(It is not necessary to support this proposal until one
	supports derived types, as that is the only way of specifying
	assignment to more than one pointer at a time.)

Rationale: this is just another kind of assignment.

Example:

      TYPE MONARCH
        INTEGER, POINTER :: P
      END TYPE MONARCH
      TYPE(MONARCH) :: A(N)
      INTEGER B(N)
      ...
C  Set up a butterfly pattern
      FORALL (J=1:N)  A(J)%P => B(1+IEOR(J-1,2**K))

Proposal B:  ALLOCATE, DEALLOCATE, and NULLIFY statements may appear
	in the body of a FORALL.

Rationale: these are just another kind of assignment.  They may have
	a kind of side effect (storage management), but it is a
	benign side effect (even milder than random number generation).

Example:

      TYPE SCREEN
        INTEGER, POINTER :: P(:,:)
      END TYPE SCREEN
      TYPE(SCREEN) :: S(N)
      INTEGER IERR(N)
      ...
C  Lots of arrays with different aspect ratios
      FORALL (J=1:N)  ALLOCATE(S(J)%P(J,N/J),STAT=IERR(J))
      IF(ANY(IERR)) GO TO 99999

Proposal C:  Delete the constraint in section 6.1.2 of the Fortran 90
	standard (page 63, lines 7 and 8):

	Constraint: In a data-ref, there must not be more than one
		part-ref with nonzero rank.  A part-name to the right
		of a part-ref with nonzero rank must not have the
		POINTER attribute.

Rationale: further opportunities for parallelism.

Example:

      TYPE(MONARCH) :: C(N), W(N)
      ...
C  Munch that butterfly
      C = C + W * A%P		!Currently illegal in Fortran 90

--Guy

---

From: [email-masked] (David Presberg)
Date: Tue, 28 Jul 92 18:06:01 EDT

A minor nit concerning an imprecision in the presentation.

I believe the Proposal A example should have the following declaration:

      INTEGER, TARGET :: B(N)

instead of the one given for B.  (Of course, you meant that the
POINTER attribute was asserted by a declaration in the ellipses
material.  ;-) )

-- Pres

---

From: [email-masked] (David Presberg)
Date: Tue, 28 Jul 92 18:06:01 EDT

INTEGER, TARGET :: B(N)

-- Pres