Go to the first, previous, next, last section, table of contents.


Find Existence of Communication

 A(N,N), B(N,N)
 DISTRIBUTE (*,BLOCK) A, B
 do i = 2, N-1
   do j = i, N-1
     A(i, j) = A(i-1, j-1)
   enddo
 enddo

For the above loop nest the owner computers rule finds the computation decomposition. See section Owner Computes Rule. In this example, the communication needed by the read access is found. Communication is needed when the data used by the read access is not in the processor executing the iteration. Since the operator Ps != Pr is not convex, the problem is divided into two subproblems; Ps > Pr and Ps < Pr.

iterl = [2 <= i <= N - 1
        i <= j <= N - 1]

dist = [blk*Ps <= bsy < blk*Ps + blk 
        blk*Pr <= bry < blk*Pr + blk ]

lhs = [bsx = i
       bsy = j ]

rhs = [brx = i
       bry = j - 1 ]

#res = {iter, dist, lhs, rhs}

#comm1 = { res
          [ Ps < Pr ] }
comm1.realsol()

#comm2 = { res
          [ Ps > Pr ] }
comm2.realsol()

end

The printout of the example session:

csh> lic -c
Rapid Prototyping System for Code Generation
> < example4
iterl = [2 <= i <= N - 1
        i <= j <= N - 1]
-1+N-j >= 0
j-i >= 0
-1+N-i >= 0
-2+i >= 0

dist = [blk*Ps <= bsy < blk*Ps + blk
        blk*Pr <= bry < blk*Pr + blk ]
-1+blk+blk*Pr-bry >= 0
-blk*Pr+bry >= 0
-1+blk+blk*Ps-bsy >= 0
-blk*Ps+bsy >= 0

lhs = [bsx = i
       bsy = j ]
bsy-j >= 0
-bsy+j >= 0
bsx-i >= 0
-bsx+i >= 0

rhs = [brx = i
       bry = j - 1 ]
1+bry-j >= 0
-1-bry+j >= 0
brx-i >= 0
-brx+i >= 0

#res = {iter, dist, lhs, rhs}

#comm1 = { res
          [ Ps < Pr ] }
comm1.realsol()
0

#comm2 = { res
          [ Ps > Pr ] }
comm2.realsol()
1

end
> quit
done(0)

csh>


Go to the first, previous, next, last section, table of contents.