Next: Successive Over Relaxation Example
Up: Scalar Variables
 Previous: Scalar Variables
 
 
Given the following assignments:
  A(2:99) = (A(:98)+A(3:))/2 ! neighbour calculations
  B(22:56)= 4.0*ATAN(1.0)    ! section of B calculated
  C(:) = SUM(D,DIM=1)        ! Sum down a column
Assuming the `owner-computes' rule,
the following distributions would be examples of good HPF programming,
 !HPF$ DISTRIBUTE (BLOCK) ONTO P   :: A
 !HPF$ DISTRIBUTE (CYCLIC) ONTO P  :: B
 !HPF$ DISTRIBUTE (BLOCK) ONTO P   :: C  ! or (CYCLIC)
 !HPF$ DISTRIBUTE (*,BLOCK) ONTO P :: D ! or (*,CYCLIC)
The following facts were used in deciding which distribution methods were
to be used:
-  A is involved in neighbourhood calculations. A(3) is
combined
with A(1) and assigned to A(2)
 -  B an `odd shaped' inner section of B is used -
in order to balance the load a CYCLIC distribution should be used.
 -  the calculation of an element of C involves a whole column
of D. This means that every element of C should be aligned
with the corresponding whole column of D.
 
Now try this question 
 
 
 
  
 Next: Successive Over Relaxation Example
Up: Scalar Variables
 Previous: Scalar Variables
Adam Marshall ©University of Liverpool, 1996
Fri Dec  6 15:03:35 GMT 1996Not for commercial use.