next up previous contents
Next: Extrinsic Procedures Up: HPF and Procedures Previous: Scalar Arguments

 

Processors Problem

HPF contains the following text:

``An HPF compiler is required to accept any PROCESSORS declaration in which the product of the extents of each declared dimension is equal to the number of physical processors that would be returned by NUMBER_OF_PROCESSORS().''

This gives handle on available resources and aids portability as all processor arrangements have same size but gives rise to problems with procedure interfaces when passing array sections.

The standard contains a fudge: ``Other cases may be handled as well.''

which gives a potential portability problem.

Return to corresponding overview page gif

 

This approach could be one solution. Here, the HPF compiler has an extension which allows processor subsets to be used in a programgif. The problem is that the subsections A(i,:) and b(i,:) are only distributed over a (10 element) slice of the processor array but HPF will not allow this to be specified. We could reconstruct the original template and so on but this is too complex. A simpler approach may be to allow processor subsets, however, as we will see later, this can lead to more problems. For example,

    REAL, DIMENSION(100,100) :: A, B
!HPF$ PROCESSORS, DIMENSION(10,10) :: P
!HPF$ DISTRIBUTE (BLOCK,BLOCK) :: A, B
    INTERFACE
     SUBROUTINE KerXubbie(x,y)
      REAL, DIMENSION(:) :: x, y
      !HPF$ PROCESSORS,DIMENSION(10) :: P ! non-HPF
      !HPF$ ALIGN y WITH *x
      !HPF$ DISTRIBUTE *(BLOCK) ONTO *P :: x
     END SUBROUTINE KerXubbie
    END INTERFACE
     ...
    CALL KerXubbie(A(i,:),b(i,:))

Asserts that x and y are co-mapped and distributed blockwise over 10 processor subset! Not portable but semantics work!

Return to corresponding overview page gif

 

HPF also specifies ``If two processor arrangements have the same shape, then corresponding elements of the two arrangements are understood to refer to the same abstract processor.'' (HPF Spec v1.1, section 3.7, P40.) Given,

!HPF$ PROCESSORS, DIMENSION(4) :: P1
!HPF$ PROCESSORS, DIMENSION(4) :: P2

This means that the two processor arrays P1 and P2 refer to the same set of four processors. If we allow the previous extension then the HPF semantics says that the dummy arguments x and y are mapped to the same 4-element processor array but in reality P1 and P2 are quite clearly not the same array:

     REAL, DIMENSION(100,100) :: A
!HPF$ PROCESSORS, DIMENSION(4,4) :: P
!HPF$ DISTRIBUTE (BLOCK,BLOCK) ONTO P :: A
      ...
      CALL Grubbie(A(1,:),A(100,:))
       ...
      SUBROUTINE Grubbie(x,y)
       REAL, DIMENSION(:) :: x, y
!HPF$ PROCESSORS, DIMENSION(4) :: P1, P2
!HPF$ DISTRIBUTE *(BLOCK) ONTO *P1 :: x
!HPF$ DISTRIBUTE *(BLOCK) ONTO *P2 :: y
       ...

Motto: tex2html_wrap29664

Return to corresponding overview page gif


next up previous contents
Next: Extrinsic Procedures Up: HPF and Procedures Previous: Scalar Arguments

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.