next up previous contents
Next: Array Arguments Example 1 Up: HPF and Procedures Previous: Explicit Intent

 

Passing Array Sections

The problem with passing array sections to procedures is how to describe the current mapping of the dummy arguments. The example below specifies an alignment between the actual arguments: B and Res and the align-target, A. In order to avoid any remapping when the subroutine Zubbie is invoked, the relationship (alignment) between its dummy arguments should be fully described. Specifying this alignment is going to be non-trivial due to the way in which the actual arguments are referenced (sectioned).

     REAL, DIMENSION(4,6) :: A, B
     REAL, DIMENSION(2,3) :: Res
!HPF$ PROCESSORS, DIMENSION(2,2) :: P
!HPF$ ALIGN B(:,:)   WITH A(:,:)
!HPF$ ALIGN Res(:,:) WITH A(::2,::2)
!HPF$ DISTRIBUTE (BLOCK,BLOCK) ONTO P :: A, B, Res
      ...
      CALL Zubbie(A(1:2,1::2),B(3:4,2::2),Res)

If we require a descriptive distribution, what should interface look like?




next up previous contents
Next: Array Arguments Example 1 Up: HPF and Procedures Previous: Explicit Intent

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 15:03:35 GMT 1996
Not for commercial use.