Consider the following statements:

REAL a(1000), b(1000), c(1000), x(500), y(0:501) INTEGER inx(1000) !HPF$ DISTRIBUTE (BLOCK) ONTO procs :: a, b, inx !HPF$ ALIGN x(i) WITH y(i+1) ... a(i) = b(i) ! Assignment 1 x(i) = y(i+1) ! Assignment 2 a(i) = c(i) ! Assignment 3 a(i) = a(i-1) + a(i) + a(i+1) ! Assignment 4 c(i) = c(i-1) + c(i) + c(i+1) ! Assignment 5 x(i) = y(i) ! Assignment 6 a(i) = a(inx(i)) + b(inx(i)) ! Assignment 7In this example, the

In Assignment 1 (`a(i) = b(i)`), the identical distribution of `a` and `b` ensures that for all `i`, `a(i)` and `b(i)`
are mapped to the same processor. Therefore, the statement requires no
communication.

In Assignment 2 (`x(i) = y(i+1)`), there is no inherent
communication. In this case, the relative alignment of the two arrays
matches the assignment statement for any actual distribution of the
arrays.

Although Assignment 3 (`a(i) = c(i)`) looks very similar to the
first assignment, the communication requirements are very different due
to the different distributions of `a` and `c`. Array elements
`a(i)` and `c(i)` are mapped to the same processor for only
10%of the possible values of `i`. (This can be seen by
inspecting the definitions of `BLOCK` and `CYCLIC` in
Section .) The elements are located on the same
processor if and only if [(*i* -1)]/100] = (*i* - 1) mod 10. For example, the assignment involves no inherent communication
(i.e., both `a(i)` and `c(i)` are on the same processor) if *i* = 1 or *i* = 102, but does require communication if *i* = 2.

REAL a(1000), b(1000), c(1000) !HPF$ DISTRIBUTE (CYCLIC) ONTO procs :: a, b, c ... a(i) = b(i+2) ! Statement 1 b(i) = c(i+3) ! Statement 2 b(i+2) = 2 * a(i+2) ! Statement 3 c(i) = a(i+1) + b(i+2) + c(i+3) ! Statement 4Statements 1 and 2 each require one array element to be communicated for any value of

- Element
`a(i+1)`induces communication, since it is not local and was not communicated earlier; - Element
`b(i+2)`induces communication, since it is nonlocal and has changed since its last use; and - Element
`c(i+3)`*does not*induce new communication, since it was used in statement 2 and not changed since.

Thus, the minimum total inherent communication in this program fragment
is four array elements. It is important to note that this is a
minimum. Some compilation strategies may produce communication for
element `c(i+3)` in the last statement.

Thu Dec 8 16:17:11 CST 1994