Subject: TRIANGULAR FORALL

From: Glossa <[email-masked]>
Date: Fri, 26 Jun 92 10:12 GMT

WHY IS FOR-ALL SO CONFUSING?

One of the reasons is that many people are not at all familiar with
the SIMD style of programming. Unfortunately, the FORTRAN 90
definers, who were being shouted down by some of those suppliers who
are now most keen on the HPFF which has resulted, were not able to
add a full set of array constructors to their language. In
particular, they didn't include the APL IOTA function or generator
of 1..N as an array. This makes use of WHERE in FOR-ALL rather less
elegant. The program usually likes nice once you have these index
arrays present.

      INTEGER IOTA(N)

C I shouldn't have to write the following loop, there should have been an 
C intrinsic. Sometimes its convenient to have such arrays globally available.

      DO I = 1,N
        IOTA(I) = I
      END DO

      FORALL ( I = 1:N, J = 1:N )
        WHERE ( SPREAD(IOTA,1,N) .GE. SPREAD(IOTA,2,N)) THERE
           body of loop 
        END WHERE
      END FORALL

I can't take very seriously the objection that this is inefficient because
the loop body may consist simply of A(I,J) = 0.0. If this were the main 
processing load then we wouldn't need an HPF!  

Tom Lake

---

From: [email-masked]
Date: Fri, 26 Jun 92 09:28:33 -0500

> Date: Fri, 26 Jun 92 10:12 GMT
> From: Glossa <[email-masked]>
> Subject: TRIANGULAR FORALL
> 

Can I suggest you propose your favorite set of array constructors to
hpff-intrinsics?  Rob Schreiber there is a friend of SIMD and array
constructs, and would probably welcome a rich set of such functions.

> processing load then we wouldn't need an HPF!  

Are you seriously claiming that the FORALL loop in your example is
clearer than
	FORALL ( I = 1:N, J = 1:N, I.GE.J )
	    body of loop
	END FORALL
(I'm guessing this is what you mean, let me know if you have a
different indexing pattern in mind.)
I agree that array constructors are useful, but I don't think this
example should require them.  For starters, why do you want to
generate two (presumably large) 2-D arrays in order to run a
triangular loop?

	Chuck