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