Subject: hpff-doc: Comments on Portable/Efficient Constructs

From: Thomas Brandes <[email-masked]>
Date: Fri, 13 Sep 1996 11:16:44 +0200

---------------------------------------------------------------------------
[email-masked] is a mailing list for HPF 2.0 language specification
authors and editors.  Instructions for adding or deleting yourself from this
list appear at the bottom of this message.
---------------------------------------------------------------------------

Comments on Portable/Efficient Constructs

a) Inconsistency between 2.4 and 7.3

   Section 2.3 (page 24, line 21-30) says

         REAL, DIMENSION(1000) :: LINUS, LUCY
   !HPF$ DISTRIBUTE (BLOCK) :: LINUS, LUCY

   LUCY and LINUS do not have necessary the same mapping because they
   might, dependending on the implementation, be distributed onto
   differently chosen processor arrangements; so corresponding elements
   of LUCY and LINUS might not reside on the same abstract processor.

   Section 7.3 (page 136) says:

   If an ONTO clause is not specified, a default arrangement is provided
   which is identical for arrays that have identical shapes, bounds, and
   identical explicit mapping directives.

   What is correct? I would vote for the last solution in any case.

b) 7.8 INDEPENDENT 

   How to distinguish the good loops from the bad ones?

   Good loops are:

   - scalar variables defined in the loop are either new variables or 
     reduction variables (this is probably necessary to be INDEPENDENT
     at all). The same should be also true for serial arrays, sequential
     and replicated data (because the compiler has to guarantee consistency
     at the end of the loop).

   - all elements of mapped array variables that are defined within
     the loop are aligned with each other (this implies that the compiler
     will choose a good home for every iteration). 

   !HPF$ INDEPENDENT
         DO i = 1, n
            x(i) = a(i) * a(i)
            d(i) = x(i) + c(i)
         END DO

   - the same array variable should not be defined and used in the same
     loop with different indexes

   !HPF$ INDEPENDENT 
         DO I = 1, N
            X(I) = ... 
            Y(I) = f(X(I+k))
         END DO 

     Here the compiler might have problems to extract the communication 

c) 7.14 Subroutine Interfaces

   Do you mean that this is not allowed ?

         REAL A(N)
   !HPF$ DISTRIBUTE A(CYCLIC(M))
         CALL SUB (A(2:N:2))

         SUBROUTINE SUB (X)
         REAL X(:)
   !HPF$ DISTRIBUTE X * ONTO *

   Passing array sections should probably always be avoided as they might
   require always redistributions!!

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