Subject: hpff-interpret: Some questions

From: <[email-masked]> (Henry Zongaro)
Date: Thu, 8 Feb 1996 18:40:41 -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.
---------------------------------------------------------------------------

Hello,

     The much-beloved section 3.10 of the HPF Language Spec. states (in part)
on page 54 that

      The rules on the interaction of the REALIGN and REDISTRIBUTE directives
      with a subprogram argument interface are:
      1. . . . .
      2. If an array or any section thereof is accessible by two or more paths,
         it is not HPF-conforming to remap it through any of those paths. . . .
         In general, in any situation where assignment to a variable would be
         nonconforming by reason of aliasing, remapping of that variable by an
         explicit REALIGN or REDISTRIBUTE directive is also forbidden.

     These rules deal explicitly with REALIGN and REDISTRIBUTE, but not with
some other situations in which aliasing might occur.  For example, is the
following a conforming program?  Here 'a' is remapped on becoming associated
with 'x'.  Can an element of 'a' then be referenced in sub?  If I had a call
to HPF_DISTRIBUTION passing 'a', what would be the AXIS_TYPE?

      program p
        integer :: a(100) = 1
!hpf$   distribute a(block)
        call sub(a)
      contains
        subroutine sub(x)
          integer x(100)
!hpf$     distribute x*(cyclic)

          i = a(1)
        end subroutine sub
      end program p

How about the following?  'a' is remapped when it becomes associated with 'x' -
can 'a' then be passed to sub2, which would require remapping as well?  Given
that REALIGN and REDISTRIBUTE are prohibited, my guess is that this would be
prohibited as well.

      program p
        integer :: a(100) = 1
!hpf$   distribute a(block)
        call sub(a)
      contains
        subroutine sub(x)
          integer x(100)
!hpf$     distribute x*(cyclic)

          call sub2(a)
        end subroutine sub

        subroutine sub2(y)
          integer y(100)
!hpf$     distribute y*(*)
        end subroutine sub2
      end program p

How about this one?  Here, the same actual argument is associated with two
different dummy arguments, each of which requires a different mapping from the
actual.

      program p
        integer :: a(10, 10) = 1
!hpf$   distribute a(block, block)
        call sub(a, a)
      contains
        subroutine sub(x, y)
          integer x(10, 10), y(10, 10)
!hpf$     distribute x*(cyclic, block)
!hpf$     distribute y*(block, cyclic)

          print *, x, y
        end subroutine sub
      end program p

If the mapping of 'x' had been the same as that of 'a', would the third example
then be conforming?

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