Subject: hpff-distribute: not atached "new" directive

From: Fabien COELHO <[email-masked]>
Date: Tue, 2 Jan 96 17:56:59 +0100

---------------------------------------------------------------------------
[email-masked] is a mailing list for discussion of data
distribution in High Performance Fortran.  Instructions for adding or
deleting yourself from this list appear at the bottom of this message.
---------------------------------------------------------------------------

Hi Chuck,

> chpf$ reduce(s)
>       forall(i=2:n-1)
>         s = s + a(i) 
>         a(i) = a(i)+a(i-1)+a(i+1)
>       end forall

The example I just posted on the net reminds me my (really real)
application with "private" scalars that required a "new" clause outside 
a loop. Forall constructs may also use scalars to avoid redundant
computations: 

chpf$ new(x) ! apply on the next loop, here the forall...
      forall(i=2:n)
        x = a(i-1)+2*a(i)+a(i+1) ! x used to store an intermediate value.
        b(i) = f1(x)             ! some pure function.
        a(i) = f2(x)             ! idem.
      end forall

Here the loop is NOT independent and x must be private to each iteration
for parallelism. I guess the compiler must expand the scalar into an array
for such a loop. I think that this kind of loop should be allowed by HPF,
and that it is not with the current definition of forall/new.
The other way around is to assume that a scalar in a forall *must* be
private (?) or to perform some analysis to prove it, but I understood that
one of the goal of the HPF Forum is that no advanced analysis technique is
needed by compilers for handling HPF. 

Hope this help. Have a nice day,

Fabien.

--
Fabien COELHO __ http://www.cri.ensmp.fr/~coelho __ [email-masked]
  CRI, ENSMP, 35, rue Saint Honoré, 77305 Fontainebleau Cedex, France
     phone: 33 1 64 69 {voice: 48 52, fax: 47 09, standard: 47 08}
       ________  All opinions expressed here are mine  ________
---------------------------------------------------------------------------
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>
---------------------------------------------------------------------------