Subject: hpff-interpret: About the remapping of a dummy in the subprogram.

From: [email-masked] (Yasuharu Hayashi)
Date: Thu, 13 Feb 97 17:57:58 JST

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

Dear HPFF:

I have two questions about the remapping of the dummy argument 
whose associated actual argument has the DYNAMIC attribute.

High Performance Fortran Language Specification Version2.0 on
p.149,l.1 says;
  
  The effect of any redistribution of the dummy after the procedure
  returns to the caller is dependent on the attribute of the actual
  argument.  If the actual argument associated with the dummy has also
  been declared DYNAMIC, then any explicit remapping of the
  dummy is visible in the caller after the procedure returns.    

EXAMPLE1:

      PROGRAM SAMPLE1
      INTERFACE
        SUBROUTINE SUB(B)
         REAL B(10)
!HPF$    PROCESSORS P(2)
!HPF$    DYNAMIC,DISTRIBUTE (BLOCK) ONTO P :: B
        ENDSUBROUTINE 
      ENDINTERFACE
      REAL A(10),B(10)
!HPF$ PROCESSORS P(2)
!HPF$ DYNAMIC,ALIGN (I) WITH B(I)       :: A
!HPF$ DYNAMIC,DISTRIBUTE (BLOCK) ONTO P :: B
         :
      CALL SUB(B)
         :
      END

      SUBROUTINE SUB(B)
      REAL B(10)
!HPF$ PROCESSORS P(2)
!HPF$ DYNAMIC,DISTRIBUTE (BLOCK) ONTO P :: B
        :
!HPF$ REDISTRIBUTE (CYCLIC) ONTO P :: B
      RETURN
      END

In EXAMPLE1, when the subroutine SUB returns and the caller 
resumes execution, the array A is remapped to maintain the alignment 
with the array B because the distribution of B was changed in the 
subroutine SUB.
Is it true?

EXAMPLE2;

      PROGRAM SAMPLE2
      INTERFACE
        SUBROUTINE SUB2(A,B)
         REAL A(10),B(10)
!HPF$    PROCESSORS P(2)
!HPF$    DISTRIBUTE (BLOCK) ONTO P :: A,B
!HPF$    DYNAMIC :: A
        ENDSUBROUTINE
      ENDINTERFACE
      REAL A(10),B(10)
!HPF$ PROCESSORS P(2)
!HPF$ DYNAMIC,ALIGN (I) WITH B(I)       :: A
!HPF$ DYNAMIC,DISTRIBUTE (BLOCK) ONTO P :: B
         :
      CALL SUB2(A,B)
         :
      END

      SUBROUTINE SUB2(A,B)
      REAL A(10),B(10)
!HPF$ PROCESSORS P(2)
!HPF$ DISTRIBUTE (BLOCK) ONTO P :: A,B
!HPF$ DYNAMIC :: A
        :
!HPF$ REDISTRIBUTE (CYCLIC) ONTO P :: A
      RETURN
      END

In EXAMPLE2, the REDISTRIBUTE directive to A in the subroutine SUB2
is not HPF conforming because it is impossible to
maintain both the alignment of the array A with the array B and 
the remapping of the array A in the subroutine SUB2 
when the subroutine SUB2 returns and the caller resumes execution.
Is it true?

Thanks,
Yasuharu Hayashi

-------------------------------------------------------------------
                            #          
       Yasuharu  Hayashi    #   NEC Corporation
                            #   [email-masked]     
-------------------------------------------------------------------

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