Subject: an implementor's questions about FORALL

From: David Loveman <[email-masked]>
Date: Thu, 21 May 92 09:54:47 PDT

How many times do the mask and the rhs in a FORALL get evaluated?

1) In a FORALL with a mask, how many times does the rhs get evaluated?

a.  as many times as the same FORALL without a mask would cause it to
be evaluated?  This is what the "roughly equivalent to" definition in
the curent proposal says.

b.  as many TRUEs as there are in the result of evaluating the mask?

2) Is 
     FORALL(. . . . ., mask). . . .
equivalent to
     IF ANY(mask) THEN
          FORALL(. . . . .,mask). . . . .
     ENDIF
?
Even with side effects?

3) Is
     FORALL(. . . . .,mask). . . . .
equivalent to
     FORALL(. . . . .)WHERE(mask). . . . .
assuming we allow WHERE in FORALL?

Comment:  There are currently three definitions of FORALL
     Appendix F of S8.104 (Fortran 8x)
     MasPar (DECmpp) Fortran
     TMC Fortran
I believe we should give a precise definition of FORALL, based on the
UNION (INTERSECTION?) of these three existing definitions + whatever
else we want to add in HPF.  This will take some language lawyering,
but will be worth it.

Let's not forget that we need efficient implementation on scalar
machines as well as on parallel machines.

---

From: [email-masked]
Date: Thu, 21 May 92 12:23:12 -0500

I'm far behind in my HPFF reading and writing (yes, the April meeting
minutes WILL be coming out soon!), so I won't comment on your
questions without some further thought.  I'd like to ask for

> else we want to add in HPF.  This will take some language lawyering,

Could someone explain the differences between the three FORALL
definitions?  I thought that the MasPar/DECmpp and TMC definitions
were equivalent.  In particular, 
	1. Is the difference just in what restrictions are placed on
	the FORALL body in each case?
	2. Or are there examples where the same body gives different
	results under different definitions?
Note that taking the union of the definitions is (maybe) practical
under the first condition, but impossible under the second.

	Chuck