1 # CLooG example file #6.
2 # Please read the first and second examples which are fully documented to
3 # understand the different parts of the input file.
5 ################################################################################
6 # do i=1,n The problem here is to generate the #
7 # | do j =1,i-1 transformation of a real-life Cholesau #
8 # | | if (j.EQ.1) then kernel according to the allocation #
9 #S1| | | s1(i,j)=a(i,j)s4(j,i)**2 functions given by a good automatic #
10 # | | else parallelizer (e.g. PAF or LooPo). For #
11 #S2| | | s1(i,j)=s1(i,j-1)-s4(j,i)**2 each statement the new schedule is: #
12 # | if (i .EQ. 1) then T_S1(i,j) =(i+j-1,i,0,j,0,0,0) #
13 #S3| | s2(i)=sqrt(a(i,i)) T_S2(i,j) =(i, i,0,j,1,0,0 #
14 # | else T_S3(i) =(i-1, i,1,0,0,0,0 #
15 #S4| | s2(i)=sqrt (s1(i,i-1)) T_S4(i) =(0, i,2,0,0,0,0) #
16 # | do k=i+1,n T_S5(i,j,k)=(j+k-1,i,3,j,0,k,0) #
17 # | | do l=1,i-1 T_S6(i,j,k)=(k, i,3,j,0,k,1) #
18 # | | | if (l .EQ. 1) then T_S7(i,j) =(i+j, i,3,j,1,0,0) #
19 #S5| | | | s3(i,k,l)=a(k,i)-(s4(l,k)*s4(l,i)) T_S8(i,j) =(j, i,3,j,2,0,0) #
21 #S6| | | | s3(i,k,l)=s3(i,k,l-1)-(s4(l,k)*s4(l,i)) #
22 # | | if (i .EQ.1) then In the generated code, every instances #
23 #S7| | | s4(i,k)=a(k,i)/s2(i) with the same p value are executed on #
24 # | | else processor number p (an allocation pb). #
25 #S8| | | s4(i,k)=s3(i,k,i-1)/s2(i) For a better view, use -fsp 2 option. #
26 ################################################################################
28 #------------------------------------CONTEXT------------------------------------
30 # 1. language: FORTRAN
33 # 2. Parameters {n | n>=10}
38 # 3. We set manually the parameter name: n
42 #-----------------------------------POLYHEDRA-----------------------------------
44 # 4. Number of polyhedra:
49 # {i, j | 1<=i<=n; 1<=j<=i-1; j=1}
61 # {i, j | 1<=i<=n; 1<=j<=i-1; j!=1}
105 # {i, j | 1<=i<=n; i+1<=j<=n; 1<=k<=i-1; k=1}
110 1 -1 1 0 0 -1 # i+1<=j
113 1 1 0 -1 0 -1 # k<=i-1
119 # {i, j | 1<=i<=n; i+1<=j<=n; 1<=k<=i-1; k!=1}
124 1 -1 1 0 0 -1 # i+1<=j
127 1 1 0 -1 0 -1 # k<=i-1
133 1 -1 1 0 0 -1 # i+1<=j
136 1 1 0 -1 0 -1 # k<=i-1
142 # {i, j | 1<=i<=n; i+1<=j<=n; i=1}
154 # {i, j | 1<=i<=n; i+1<=j<=n; i!=1}
171 # 6. We let CLooG choose the iterator names
174 #----------------------------------SCATTERING-----------------------------------
176 # 7. Scattering functions ALLOCATION + ORIGINAL SCHEDULING
179 # Scattering function for polyhedron #1: T_S1(i,j) =(i+j-1,i,0,j,0,0,0)
181 # p c1 c2 c3 c4 c5 c6 i j n 1
182 0 1 0 0 0 0 0 0 -1 -1 0 1 # ins1: i+j-1
183 0 0 1 0 0 0 0 0 -1 0 0 0 # i
184 0 0 0 1 0 0 0 0 0 0 0 0 # 0
185 0 0 0 0 1 0 0 0 0 -1 0 0 # j
186 0 0 0 0 0 1 0 0 0 0 0 0 # 0
187 0 0 0 0 0 0 1 0 0 0 0 0 # 0
188 0 0 0 0 0 0 0 1 0 0 0 0 # 0
190 # Scattering function for polyhedron #2: T_S2(i,j) =(i,i,0,j,1,0,0)
192 # p c1 c2 c3 c4 c5 c6 i j n 1
193 0 1 0 0 0 0 0 0 -1 0 0 0 # ins2: i
194 0 0 1 0 0 0 0 0 -1 0 0 0 # i
195 0 0 0 1 0 0 0 0 0 0 0 0 # 0
196 0 0 0 0 1 0 0 0 0 -1 0 0 # j
197 0 0 0 0 0 1 0 0 0 0 0 -1 # 1
198 0 0 0 0 0 0 1 0 0 0 0 0 # 0
199 0 0 0 0 0 0 0 1 0 0 0 0 # 0
201 # Scattering function for polyhedron #3: T_S3(i) =(i-1,i,1,0,0,0,0)
203 # p c1 c2 c3 c4 c5 c6 i n 1
204 0 1 0 0 0 0 0 0 -1 0 1 # ins3: i-1
205 0 0 1 0 0 0 0 0 -1 0 0 # i
206 0 0 0 1 0 0 0 0 0 0 -1 # 1
207 0 0 0 0 1 0 0 0 0 0 0 # 0
208 0 0 0 0 0 1 0 0 0 0 0 # 0
209 0 0 0 0 0 0 1 0 0 0 0 # 0
210 0 0 0 0 0 0 0 1 0 0 0 # 0
212 # Scattering function for polyhedron #4: T_S4(i) =(0,i,2,0,0,0,0)
214 # p c1 c2 c3 c4 c5 c6 i n 1
215 0 1 0 0 0 0 0 0 0 0 0 # ins4: 0
216 0 0 1 0 0 0 0 0 -1 0 0 # i
217 0 0 0 1 0 0 0 0 0 0 -2 # 2
218 0 0 0 0 1 0 0 0 0 0 0 # 0
219 0 0 0 0 0 1 0 0 0 0 0 # 0
220 0 0 0 0 0 0 1 0 0 0 0 # 0
221 0 0 0 0 0 0 0 1 0 0 0 # 0
223 # Scattering function for polyhedron #5: T_S5(i,j,k)=(j+k-1,i,3,j,0,k,0)
225 # p c1 c2 c3 c4 c5 c6 i j k n 1
226 0 1 0 0 0 0 0 0 0 -1 -1 0 1 # ins 5: j+k-1
227 0 0 1 0 0 0 0 0 -1 0 0 0 0 # i
228 0 0 0 1 0 0 0 0 0 0 0 0 -3 # 3
229 0 0 0 0 1 0 0 0 0 -1 0 0 0 # j
230 0 0 0 0 0 1 0 0 0 0 0 0 0 # 0
231 0 0 0 0 0 0 1 0 0 0 -1 0 0 # k
232 0 0 0 0 0 0 0 1 0 0 0 0 0 # 0
234 # Scattering function for polyhedron #6: T_S6(i,j,k)=(k,i,3,j,0,k,1)
236 # p c1 c2 c3 c4 c5 c6 i j k n 1
237 0 1 0 0 0 0 0 0 0 0 -1 0 0 # ins 6: k
238 0 0 1 0 0 0 0 0 -1 0 0 0 0 # i
239 0 0 0 1 0 0 0 0 0 0 0 0 -3 # 3
240 0 0 0 0 1 0 0 0 0 -1 0 0 0 # j
241 0 0 0 0 0 1 0 0 0 0 0 0 0 # 0
242 0 0 0 0 0 0 1 0 0 0 -1 0 0 # k
243 0 0 0 0 0 0 0 1 0 0 0 0 -1 # 1
245 # Scattering function for polyhedron #7: T_S7(i,j) =(i+j,i,3,j,1,0,0)
247 # p c1 c2 c3 c4 c5 c6 i j n 1
248 0 1 0 0 0 0 0 0 -1 -1 0 0 # ins 7: i+j
249 0 0 1 0 0 0 0 0 -1 0 0 0 # i
250 0 0 0 1 0 0 0 0 0 0 0 -3 # 3
251 0 0 0 0 1 0 0 0 0 -1 0 0 # j
252 0 0 0 0 0 1 0 0 0 0 0 -1 # 1
253 0 0 0 0 0 0 1 0 0 0 0 0 # 0
254 0 0 0 0 0 0 0 1 0 0 0 0 # 0
256 # Scattering function for polyhedron #8: T_S8(i,j) =(j,i,3,j,2,0,0)
258 # p c1 c2 c3 c4 c5 c6 i j n 1
259 0 1 0 0 0 0 0 0 0 -1 0 0 # ins 8: j
260 0 0 1 0 0 0 0 0 -1 0 0 0 # i
261 0 0 0 1 0 0 0 0 0 0 0 -3 # 3
262 0 0 0 0 1 0 0 0 0 -1 0 0 # j
263 0 0 0 0 0 1 0 0 0 0 0 -2 # 2
264 0 0 0 0 0 0 1 0 0 0 0 0 # 0
265 0 0 0 0 0 0 0 1 0 0 0 0 # 0
267 # We want to set manually the scattering dimension names.