Subject: Re: hpff-interpret: INDEPENDENT

From: <[email-masked]> (Henry Zongaro)
Date: Tue, 2 Apr 1996 14:28:40 -0500 (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.
---------------------------------------------------------------------------

Hi Jens,

> Is this a legal use of INDEPENDENT & NEW ???
>
> REAL x, y(n)
>
> !HPF$ INDEPENDENT, NEW(i)
> DO i = 1, n
>    x = x + y(i)            ! Clumsy way to calculate: x=SUM(y)
> END DO
>
>
> Jens Helmers,
> [email-masked]

     This is not a legal use of INDEPENDENT, unless n <= 1.  When the
INDEPENDENT directive appears before a DO, it asserts to the compiler that
(among other things) two iterations of the DO will not assign to the same
atomic object.  Here, the assignment to x violates that condition, unless n is
less than or equal to 1.

     A proposal that will appear in the HPF 2.0 document will permit some DO
loops which perform intrinsic reduction operations to be marked as INDEPENDENT,
like so:

  REAL x, y(n)

  x = 0.0
  !HPF$ INDEPENDENT, NEW(i), REDUCTION(x)
  DO i = 1, n
     x = x + y(i)
  END DO

Thanks,

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