next up previous contents
Next: Examples of Good Distributions Up: Data Distribution Previous: The Owner-Computes Rule

 

Scalar Variables

Unless explicitly mapped, scalar variables are generally replicated, in other words, every processor has a copy of the variable.

The compiler must ensure that these copies are kept up-to date (or coherent). Consider,

     REAL, DIMENSION(100,100) :: X
     REAL                     :: Scal
!HPF$ DISTRIBUTE (BLOCK,BLOCK) :: X
       ....
      Scal = X(i,j)
       ....

The processor that owns X(i,j) updates its copy of Scal and then broadcasts its new value to all other processors.

To achieve the effect of having a different scalar value on each processor, one must declare an array with as many elements as there are processors. This array can be distributed so that each processor receives just one element - this element can now be treated like a local scalar.

Return to corresponding overview page gif




next up previous contents
Next: Examples of Good Distributions Up: Data Distribution Previous: The Owner-Computes Rule

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