We have integrated the different tools into an interactive program called CIPOL. CIPOL provides a lisplike textual interface to the tools, and prettyprints their results.Program MatInit !HPF$ PROCESSORS P(8,8) do i=1,n !HPF$ TEMPLATE T(n,m) do j=1,m !HPF$ DISTRIBUTE T(CYCLIC,CYCLIC) ONTO P A(i,j)=B(i) (S1) real A(n,m), B(n) end do !HPF$ ALIGN A(i,j) WITH T(i,*) end do !HPF$ ALIGN B(i) WITH T(i,1) end
The generic sets for our example are:The first set means that the i^{th} row of array A is duplicated on each element of the i^{th} row of template T. The second set shows that array B is aligned with the first column of template T.
F_{A}^{1}(j_{1},j_{2},n,m)= ì
í
î
1£ j_{1}£ n Ù i_{1}=j_{1} 1£ i_{2}£ m , F_{B}(i_{1},i_{2},n,m)= ì
í
î
1£ i_{1}£ n Ù j'_{1}=i_{1} j'_{2}=1 .
lexmin(C,S(I,J)) , C= 
ì ï í ï î 

, S(I,J)= 
ì í î 

. (7) 

. 
ì í î 

. (8) 
For our program example MatInit, the template is distributed on the processor grid using two CYCLIC patterns, hence the distribution is defined by:The integer problem to solve is lexmin(C(n,m),S(i_{1},i_{2},j_{1},j_{2})) with
r_{T} æ
è
j_{1} j_{2} ö
ø= æ
è
j_{1} j_{2} ö
ø, k_{T} = æ
è
1 1 ö
ø. One may note that, in this example, there is no variable representing the remainder in the division by k_{T} (as R in (8)) since the block sizes are equal to 1. The result of PIP is that there exists a solution not equal to ^ in the polyhedron defined by:
C(n,m)= {
1£ j_{1}£ n Ù 1£ j_{2}£ m Ù i_{1}=j_{1} Ù 1£ i_{2}£ m ,
S(i_{1},i_{2},j_{1},j_{2})= ì
ï
í
ï
î
j'_{1}=i_{1} Ù j'_{2}=1 Ù 1£ p_{1}£ 8 Ù 1£ p_{2}£ 8 j_{1}1=8q_{1}+p_{1}1 Ù j_{2}1=8q_{2}+p_{2}1 j'_{1}1=8q'_{1}+p_{1}1 Ù j'_{2}1=8q'_{2}+p_{2}1 q_{1}³ 0 Ù q_{2}³ 0 Ù q'_{1}³ 0 Ù q'_{2}³ 0 . The new parameter q is used to express that j_{2}1 must be a multiple of 8.
C (n,m)= {
1£ j_{1}£ n Ù 1£ j_{2}£ m Ù i_{1}=j_{1} Ù 1£ i_{2}£ m Ù j_{2}1=8q Ù q³ 0 .
For the example MatInit the final result (in the context n³ 1 and m³ 1) isFor a detailled description of how the preevaluation can be done in an automatic way take a look at the report available at the URLThe brackets on the previous expression denote a periodic number: if we denote by v the vector (0,7/8,3/4,5/8,1/2, 3/8,1/4,1/8), the value of the periodic number is v_{m%8}.
Count(C(n,m)) Count(
C (n,m)) = n.m æ
ç
ç
ç
ç
ç
è
7m
8  é
ê
ê
ë0,
7
8 ,
3
4 ,
5
8 ,
1
2 ,
3
8 ,
1
4 ,
1
8 ù
ú
ú
û
m ö
÷
÷
÷
÷
÷
ø
When the parameter m is a multiple of 8 we have the expected result of 7n.m^{2}/8 atomic communications at the template level.