source: trunk/softs/soft_filter_giet/main.c @ 248

Last change on this file since 248 was 248, checked in by meunier, 12 years ago

Updates in the soft_filter application (bug corrections, formatting, and adaptation to the architecture generic_mmu)

File size: 23.3 KB
RevLine 
[248]1
2#include "limits.h"
[158]3#include "stdio.h"
4
[248]5#include "../giet_tsar/block_device.h"
6
[158]7////////////////////////////////////
8// Image parameters
9
[248]10#define NB_CLUSTER_MAX 256
11#define PIXEL_SIZE     2
12#define NL             1024
13#define NP             1024
[158]14
[248]15#define NB_PIXELS      ((NP) * (NL))
16#define FRAME_SIZE     ((NB_PIXELS) * (PIXEL_SIZE))
[158]17
[248]18#define PRINTF(...)      ({ if (proc_id == 1) { tty_printf(__VA_ARGS__); } })
[158]19
[248]20#define TA(c,l,p)  (A[c][((NP) * (l)) + (p)])
21#define TB(c,p,l)  (B[c][((NL) * (p)) + (l)])
22#define TC(c,l,p)  (C[c][((NP) * (l)) + (p)])
23#define TD(c,l,p)  (D[c][((NP) * (l)) + (p)])
24#define TZ(c,l,p)  (Z[c][((NP) * (l)) + (p)])
25
[158]26#define max(x,y) ((x) > (y) ? (x) : (y))
27#define min(x,y) ((x) < (y) ? (x) : (y))
28
29///////////////////////////////////////////
30// tricks to read parameters from ldscript
31///////////////////////////////////////////
32
33struct plaf;
34
[248]35extern struct plouf seg_ioc_base;
[158]36extern struct plaf seg_heap_base;
37extern struct plaf NB_PROCS;
38extern struct plaf NB_CLUSTERS;
39
40
[248]41// Required when initializing an array all at once
42static void *memcpy(void *_dst, const void *_src, unsigned int size){
43   unsigned int *dst = _dst;
44   const unsigned int *src = _src;
45   if (! ((unsigned int)dst & 3) && ! ((unsigned int)src & 3)){
46      while (size > 3){
47         *dst++ = *src++;
48         size -= 4;
49      }
50   }
[158]51
[248]52   unsigned char *cdst = (unsigned char*)dst;
53   unsigned char *csrc = (unsigned char*)src;
[158]54
[248]55   while (size--){
56      *cdst++ = *csrc++;
57   }
58   return _dst;
59}
[158]60
61
62
63
64
65
66
[170]67
[248]68void main(){
[170]69
[248]70   //////////////////////////////////
71   // convolution kernel parameters
72   // The content of this section is
73   // Philips proprietary information.
74   ///////////////////////////////////
[158]75
[248]76   int   vnorm  = 115;
77   int   vf[35] = { 1, 1, 2, 2, 2,
78                    2, 3, 3, 3, 4,
79                    4, 4, 4, 5, 5,
80                    5, 5, 5, 5, 5,
81                    5, 5, 4, 4, 4,
82                    4, 3, 3, 3, 2,
83                    2, 2, 2, 1, 1 };
[158]84
[248]85   int hrange = 100;
86   int hnorm  = 201;
[158]87
[248]88   unsigned int date = 0;
[158]89
[248]90   int c; // cluster index for loops
91   int l; // line index for loops
92   int p; // pixel index for loops
93   int x; // filter index for loops
[158]94
[248]95   const unsigned int proc_id       = procid();                      // processor id
96   const unsigned int nlocal_procs  = (int) &NB_PROCS;               // number of processors per cluster
97   const unsigned int nclusters     = (int) &NB_CLUSTERS;            // number of clusters
98   const unsigned int local_id      = proc_id % nlocal_procs;        // local task id
99   const unsigned int cluster_id    = proc_id / nlocal_procs;        // cluster task id
100   const unsigned int base          = (unsigned int) &seg_heap_base; // base address for shared buffers
101   const unsigned int increment     = 0x80000000 / nclusters * 2;    // cluster increment
102   const unsigned int nglobal_procs = nclusters * nlocal_procs;      // number of tasks
103   const unsigned int npixels       = NB_PIXELS;                     // Number of pixel per frame
104   const unsigned int frame_size    = FRAME_SIZE;                    // Size of 1 frame (in bytes)
105   const unsigned int * ioc_address = (unsigned int *) &seg_ioc_base;
106   const unsigned int block_size    = ioc_address[BLOCK_DEVICE_BLOCK_SIZE];
107   const unsigned int nblocks       = frame_size / block_size;       // number of blocks per frame
[158]108
[248]109   const unsigned int lines_per_task     = NL / nglobal_procs; // number of lines per task
110   const unsigned int lines_per_cluster  = NL / nclusters;     // number of lines per cluster
111   const unsigned int pixels_per_task    = NP / nglobal_procs; // number of columns per task
112   const unsigned int pixels_per_cluster = NP / nclusters;     // number of columns per cluster
[158]113
[248]114   int first, last;
[158]115
[248]116   PRINTF("\n*** Processor %d entering main at cycle %d ***\n\n", proc_id, proctime());
[158]117
[248]118   //*(unsigned int *) 0x60000000 = *(unsigned int *) 0x70000000;
119   //PRINTF("apres acces illegal\n");
[158]120
[248]121   /////////////////////////
122   // parameters checking //
123   /////////////////////////
124   
[158]125
[248]126   if ((nlocal_procs != 1) && (nlocal_procs != 2) && (nlocal_procs != 4)){
127      PRINTF("NB_PROCS must be 1, 2 or 4\n");
128      exit();
129   }
[158]130
[248]131   if ((nclusters !=  4) && (nclusters !=  8) && (nclusters != 16) && 
132         (nclusters != 32) && (nclusters != 64) && (nclusters !=128) && (nclusters != 256)){
133      PRINTF("NB_CLUSTERS must be a power of 2 between 4 and 256\n");
134      exit();
135   }
[158]136
[248]137   if (proc_id >= nglobal_procs){
138      PRINTF("processor id %d larger than NB_CLUSTERS*NB_PROCS\n", proc_id);
139      exit();
140   }
[158]141
[248]142   if (NL % nclusters != 0){
143      PRINTF("NB_CLUSTERS must be a divider of NL");
144      exit();
145   }
[158]146
[248]147   if (NP % nclusters != 0){
148      PRINTF("NB_CLUSTERS must be a divider of NP");
149      exit();
150   }
[158]151
152
[248]153   // Arrays of pointers on the shared, distributed buffers 
154   // containing the images (sized for the worst case : 256 clusters)
155   unsigned short * A[NB_CLUSTER_MAX];
156   int *            B[NB_CLUSTER_MAX];
157   int *            C[NB_CLUSTER_MAX];
158   int *            D[NB_CLUSTER_MAX];
159   unsigned char *  Z[NB_CLUSTER_MAX];
[158]160
[248]161   // Arrays of pointers on the instrumentation arrays
162   // These arrays are indexed by the cluster index (sized for the worst case : 256 clusters)
163   // each pointer points on the base adress of an array of 4 (NPROCS max) unsigned int
164   unsigned int * LOAD_START[NB_CLUSTER_MAX];
165   unsigned int * LOAD_END[NB_CLUSTER_MAX];
166   unsigned int * VERT_START[NB_CLUSTER_MAX];
167   unsigned int * VERT_END[NB_CLUSTER_MAX];
168   unsigned int * HORI_START[NB_CLUSTER_MAX];
169   unsigned int * HORI_END[NB_CLUSTER_MAX];
170   unsigned int * DISP_START[NB_CLUSTER_MAX];
171   unsigned int * DISP_END[NB_CLUSTER_MAX];
[158]172
[248]173   // The shared, distributed buffers addresses are computed
174   // from the seg_heap_base value defined in the ldscript file
175   // and from the cluster increment = 4Gbytes/nclusters.
176   // These arrays of pointers are identical and
177   // replicated in the stack of each task
178   for (c = 0; c < nclusters; c++){
179      unsigned int offset = base + increment * c;
180      A[c] = (unsigned short *) (offset                             );
181      B[c] = (int *)            (offset + frame_size * 1 / nclusters); // We increment by 2 * frame_size
182      C[c] = (int *)            (offset + frame_size * 3 / nclusters); // because sizeof(int) = 2*sizeof(short)
183      D[c] = (int *)            (offset + frame_size * 5 / nclusters); // so an array of frame_size elements of type
184      Z[c] = (unsigned char *)  (offset + frame_size * 7 / nclusters); // int can contain the equivalent of 2 frames
[158]185
[248]186      offset = base + increment * c + frame_size * 8 / nclusters;
187      LOAD_START[c] = (unsigned int *) (offset + nlocal_procs * sizeof(unsigned int) * 0);
188      LOAD_END[c]   = (unsigned int *) (offset + nlocal_procs * sizeof(unsigned int) * 1);
189      VERT_START[c] = (unsigned int *) (offset + nlocal_procs * sizeof(unsigned int) * 2);
190      VERT_END[c]   = (unsigned int *) (offset + nlocal_procs * sizeof(unsigned int) * 3);
191      HORI_START[c] = (unsigned int *) (offset + nlocal_procs * sizeof(unsigned int) * 4);
192      HORI_END[c]   = (unsigned int *) (offset + nlocal_procs * sizeof(unsigned int) * 5);
193      DISP_START[c] = (unsigned int *) (offset + nlocal_procs * sizeof(unsigned int) * 6);
194      DISP_END[c]   = (unsigned int *) (offset + nlocal_procs * sizeof(unsigned int) * 7);
195   }
[158]196
[248]197   PRINTF("NB_CLUSTERS     = %d\n", nclusters); 
198   PRINTF("NB_LOCAL_PROCS  = %d\n", nlocal_procs); 
199   PRINTF("NB_GLOBAL_PROCS = %d\n", nglobal_procs);
200   PRINTF("NB_PIXELS       = %d\n", npixels);
201   PRINTF("PIXEL_SIZE      = %d\n", PIXEL_SIZE);
202   PRINTF("FRAME_SIZE      = %d\n", frame_size);
203   PRINTF("BLOCK_SIZE      = %d\n", block_size);
204   PRINTF("NB_BLOCKS       = %d\n\n", nblocks);
[158]205
206
[248]207   PRINTF("*** Starting barrier init at cycle %d ***\n", proctime());
[158]208
[248]209   //  barriers initialization
210   barrier_init(0, nglobal_procs);
211   barrier_init(1, nglobal_procs);
212   barrier_init(2, nglobal_procs);
213   barrier_init(3, nglobal_procs);
[158]214
[248]215   PRINTF("*** Completing barrier init at cycle %d ***\n", proctime());
[158]216
217
[248]218   ////////////////////////////////////////////////////////
219   // pseudo parallel load from disk to A[c] buffers
220   // only task running on processor with (local_id==0) does it
221   // nblocks/nclusters are loaded in each cluster
222   ////////////////////////////////////////////////////////
[158]223
[248]224   if (local_id == 0){
225      int p;
226      date  = proctime();
227      PRINTF("\n*** Starting load at cycle %d\n", date);
228      for (p = 0; p < nlocal_procs; p++){
229         LOAD_START[cluster_id][p] = date;
230      }
[158]231
[248]232      if (ioc_read(nblocks*cluster_id/nclusters, A[cluster_id], nblocks/nclusters)){
233         PRINTF("echec ioc_read\n");
234         exit(1);
235      }
236      if (ioc_completed()){
237         PRINTF("echec ioc_completed\n");
238         exit(1);
239      }
[158]240
[248]241      date  = proctime();
242      PRINTF("*** Completing load at cycle %d\n", date);
243      for (p = 0; p < nlocal_procs; p++){
244         LOAD_END[cluster_id][p] = date;
245      }
246   }
[158]247
[248]248   barrier_wait(0);
[158]249
250
[248]251   ////////////////////////////////////////////////////////
252   // parallel horizontal filter :
253   // B <= transpose(FH(A))
254   // D <= A - FH(A)
255   // Each task computes (NL/nglobal_procs) lines
256   // The image must be extended :
257   // if (z<0)    TA(cluster_id,l,z) == TA(cluster_id,l,0)
258   // if (z>NP-1) TA(cluster_id,l,z) == TA(cluster_id,l,NP-1)
259   ////////////////////////////////////////////////////////
[158]260
[248]261   date  = proctime();
262   PRINTF("\n*** Starting horizontal filter at cycle %d\n", date);
263   HORI_START[cluster_id][local_id] = date;
[158]264
[248]265   // l = absolute line index / p = absolute pixel index 
266   // first & last define which lines are handled by a given task(cluster_id,local_id)
[158]267
[248]268   first = (cluster_id * nlocal_procs + local_id) * lines_per_task;
269   last  = first + lines_per_task;
[162]270
[248]271   for (l = first; l < last; l++){
272      // src_c and src_l are the cluster index and the line index for A & D
273      int src_c = l / lines_per_cluster;
274      int src_l = l % lines_per_cluster;
[158]275
[248]276      // We use the specific values of the horizontal ep-filter for optimisation:
277      // sum(p) = sum(p-1) + TA[p+hrange] - TA[p-hrange-1]
278      // To minimize the number of tests, the loop on pixels is split in three domains
[158]279
[248]280      int sum_p = (hrange + 2) * TA(src_c, src_l, 0);
281      for (x = 1; x < hrange; x++){
282         sum_p = sum_p + TA(src_c, src_l, x);
283      }
[170]284
[248]285      // first domain : from 0 to hrange
286      for (p = 0; p < hrange + 1; p++){
287         // dst_c and dst_p are the cluster index and the pixel index for B
288         int dst_c = p / pixels_per_cluster;
289         int dst_p = p % pixels_per_cluster;
290         sum_p = sum_p + (int) TA(src_c, src_l, p + hrange) - (int) TA(src_c, src_l, 0);
291         TB(dst_c, dst_p, l) = sum_p / hnorm;
292         TD(src_c, src_l, p) = (int) TA(src_c, src_l, p) - sum_p / hnorm;
293      }
294      // second domain : from (hrange+1) to (NP-hrange-1)
295      for (p = hrange + 1; p < NP - hrange; p++){
296         // dst_c and dst_p are the cluster index and the pixel index for B
297         int dst_c = p / pixels_per_cluster;
298         int dst_p = p % pixels_per_cluster;
299         sum_p = sum_p + (int) TA(src_c, src_l, p + hrange) - (int) TA(src_c, src_l, p - hrange - 1);
300         TB(dst_c, dst_p, l) = sum_p / hnorm;
301         TD(src_c, src_l, p) = (int) TA(src_c, src_l, p) - sum_p / hnorm;
302      }
303      // third domain : from (NP-hrange) to (NP-1)
304      for (p = NP - hrange; p < NP; p++){
305         // dst_c and dst_p are the cluster index and the pixel index for B
306         int dst_c = p / pixels_per_cluster;
307         int dst_p = p % pixels_per_cluster;
308         sum_p = sum_p + (int) TA(src_c, src_l, NP - 1) - (int) TA(src_c, src_l, p - hrange - 1);
309         TB(dst_c, dst_p, l) = sum_p / hnorm;
310         TD(src_c, src_l, p) = (int) TA(src_c, src_l, p) - sum_p / hnorm;
311      }
[170]312
[248]313      PRINTF(" - line %d computed at cycle %d\n", l, proctime());
314   }
[170]315
[248]316   date  = proctime();
317   PRINTF("*** Completing horizontal filter at cycle %d\n", date);
318   HORI_END[cluster_id][local_id] = date;
[170]319
[248]320   barrier_wait(1);
[170]321
322
[248]323   //////////////////////////////////////////////////////////
324   // parallel vertical filter :
325   // C <= transpose(FV(B))
326   // Each task computes (NP/nglobal_procs) columns
327   // The image must be extended :
328   // if (l<0)    TB(cluster_id,p,x) == TB(cluster_id,p,0)
329   // if (l>NL-1)   TB(cluster_id,p,x) == TB(cluster_id,p,NL-1)
330   //////////////////////////////////////////////////////////
[174]331
[248]332   date  = proctime();
333   PRINTF("\n*** starting vertical filter at cycle %d\n", date);
334   VERT_START[cluster_id][local_id] = date;
[170]335
[248]336   // l = absolute line index / p = absolute pixel index
337   // first & last define which pixels are handled by a given task(cluster_id,local_id)
[170]338
[248]339   first = (cluster_id * nlocal_procs + local_id) * pixels_per_task;
340   last  = first + pixels_per_task;
[170]341
[248]342   for (p = first; p < last; p++){
343      // src_c and src_p are the cluster index and the pixel index for B
344      int src_c = p / pixels_per_cluster;
345      int src_p = p % pixels_per_cluster;
[170]346
[248]347      int sum_l;
[170]348
[248]349      // We use the specific values of the vertical ep-filter
350      // To minimize the number of tests, the NL lines are split in three domains
[170]351
[248]352      // first domain : explicit computation for the first 18 values
353      for (l = 0; l < 18; l++){
354         // dst_c and dst_l are the cluster index and the line index for C
355         int dst_c = l / lines_per_cluster;
356         int dst_l = l % lines_per_cluster;
[170]357
[248]358         for (x = 0, sum_l = 0; x < 35; x++){
359            sum_l = sum_l + vf[x] * TB(src_c, src_p, max(l - 17 + x,0) );
360         }
361         TC(dst_c, dst_l, p) = sum_l / vnorm;
362      }
363      // second domain
364      for (l = 18; l < NL - 17; l++){
365         // dst_c and dst_l are the cluster index and the line index for C
366         int dst_c = l / lines_per_cluster;
367         int dst_l = l % lines_per_cluster;
[170]368
[248]369         sum_l = sum_l + TB(src_c, src_p, l + 4)
370            + TB(src_c, src_p, l + 8)
371            + TB(src_c, src_p, l + 11)
372            + TB(src_c, src_p, l + 15)
373            + TB(src_c, src_p, l + 17)
374            - TB(src_c, src_p, l - 5)
375            - TB(src_c, src_p, l - 9)
376            - TB(src_c, src_p, l - 12)
377            - TB(src_c, src_p, l - 16)
378            - TB(src_c, src_p, l - 18);
379         TC(dst_c, dst_l, p) = sum_l / vnorm;
380      }
381      // third domain
382      for (l = NL - 17; l < NL; l++){
383         // dst_c and dst_l are the cluster index and the line index for C
384         int dst_c = l / lines_per_cluster;
385         int dst_l = l % lines_per_cluster;
[174]386
[248]387         sum_l = sum_l + TB(src_c, src_p, min(l + 4, NL - 1))
388            + TB(src_c, src_p, min(l + 8, NL - 1))
389            + TB(src_c, src_p, min(l + 11, NL - 1))
390            + TB(src_c, src_p, min(l + 15, NL - 1))
391            + TB(src_c, src_p, min(l + 17, NL - 1))
392            - TB(src_c, src_p, l - 5)
393            - TB(src_c, src_p, l - 9)
394            - TB(src_c, src_p, l - 12)
395            - TB(src_c, src_p, l - 16)
396            - TB(src_c, src_p, l - 18);
397         TC(dst_c, dst_l, p) = sum_l / vnorm;
398      }
399      PRINTF(" - column %d computed at cycle %d\n", p, proctime());
400   }
401
402   date  = proctime();
403   PRINTF("*** Completing vertical filter at cycle %d\n", date);
404   VERT_END[cluster_id][local_id] = date;
405
406   barrier_wait(2);
407
408
409   ////////////////////////////////////////////////////////////////
410   // final computation and parallel display
411   // Z <= D + C
412   // Each processor use its private DMA channel to display
413   // the resulting image, line  per line (one byte per pixel).
414   // Eah processor computes & displays (NL/nglobal_procs) lines.
415   ////////////////////////////////////////////////////////////////
416
417   date  = proctime();
418   PRINTF("\n*** Starting display at cycle %d\n", date);
419   DISP_START[cluster_id][local_id] = date;
420
421   first = local_id * lines_per_task;
422   last  = first + lines_per_task;
423
424   for (l = first; l < last; l++){
425      for (p = 0; p < NP; p++){
426         TZ(cluster_id,l,p) = (unsigned char) (((TD(cluster_id,l,p) + TC(cluster_id,l,p)) >> 8) & 0xFF);
427      }
428      fb_sync_write(NP * (cluster_id * lines_per_cluster + l), &TZ(cluster_id,l,0), NP);
429   }
430
431#if 0
432   for (l = first; l < last; l++){
433      for (p = 0; p < NP; p++){
434         TA(cluster_id, l, p) = (unsigned char) ((TA(cluster_id, l, p) >> 8) & 0xFF);
435      }
436      fb_write(NP * (cluster_id * lines_per_cluster + l), &TA(cluster_id,l,0), NP);
437   }
438#endif
439
440   date  = proctime();
441   PRINTF("*** Completing display at cycle %d\n", date);
442   DISP_END[cluster_id][local_id] = date;
443
444   barrier_wait(3);
445
446   
447   /////////////////////////////////////////////////////////
448   // Instrumentation (done by processor 0 in cluster 0)   
449   /////////////////////////////////////////////////////////
450
451   if (proc_id == 0){
452      date  = proctime();
453      PRINTF("\n*** Starting Instrumentation at cycle %d\n\n", date);
454
455      int cc, pp;
456      unsigned int min_load_start = INT_MAX;
457      unsigned int max_load_start = 0;
458      unsigned int min_load_ended = INT_MAX;
459      unsigned int max_load_ended = 0;
460
461      unsigned int min_hori_start = INT_MAX;
462      unsigned int max_hori_start = 0;
463      unsigned int min_hori_ended = INT_MAX;
464      unsigned int max_hori_ended = 0;
465
466      unsigned int min_vert_start = INT_MAX;
467      unsigned int max_vert_start = 0;
468      unsigned int min_vert_ended = INT_MAX;
469      unsigned int max_vert_ended = 0;
470
471      unsigned int min_disp_start = INT_MAX;
472      unsigned int max_disp_start = 0;
473      unsigned int min_disp_ended = INT_MAX;
474      unsigned int max_disp_ended = 0;
475
476      for (cc = 0; cc < nclusters; cc++){
477         for (pp = 0; pp < nlocal_procs; pp++ ){
478            if (LOAD_START[cc][pp] < min_load_start){
479               min_load_start = LOAD_START[cc][pp];
[174]480            }
[248]481            if (LOAD_START[cc][pp] > max_load_start){
482               max_load_start = LOAD_START[cc][pp];
[174]483            }
[248]484            if (LOAD_END[cc][pp] < min_load_ended){
485               min_load_ended = LOAD_END[cc][pp];
[174]486            }
[248]487            if (LOAD_END[cc][pp] > max_load_ended){
488               max_load_ended = LOAD_END[cc][pp];
[174]489            }
[248]490
491            if (HORI_START[cc][pp] < min_hori_start){
492               min_hori_start = HORI_START[cc][pp];
[174]493            }
[248]494            if (HORI_START[cc][pp] > max_hori_start){
495               max_hori_start = HORI_START[cc][pp];
[174]496            }
[248]497            if (HORI_END[cc][pp] < min_hori_ended){
498               min_hori_ended = HORI_END[cc][pp];
[174]499            }
[248]500            if (HORI_END[cc][pp] > max_hori_ended){
501               max_hori_ended = HORI_END[cc][pp];
[174]502            }
503
[248]504            if (VERT_START[cc][pp] < min_vert_start){
505               min_vert_start = VERT_START[cc][pp];
506            }
507            if (VERT_START[cc][pp] > max_vert_start){
508               max_vert_start = VERT_START[cc][pp];
509            }
510            if (VERT_END[cc][pp] < min_vert_ended){
511               min_vert_ended = VERT_END[cc][pp];
512            }
513            if (VERT_END[cc][pp] > max_vert_ended){
514               max_vert_ended = VERT_END[cc][pp];
515            }
[158]516
[248]517            if (DISP_START[cc][pp] < min_disp_start){
518               min_disp_start = DISP_START[cc][pp];
519            }
520            if (DISP_START[cc][pp] > max_disp_start){
521               max_disp_start = DISP_START[cc][pp];
522            }
523            if (DISP_END[cc][pp] < min_disp_ended){
524               min_disp_ended = DISP_END[cc][pp];
525            }
526            if (DISP_END[cc][pp] > max_disp_ended){
527               max_disp_ended = DISP_END[cc][pp];
528            }
529         }
530      }
531      PRINTF(" - LOAD_START : min = %d / max = %d / med = %d / delta = %d\n",
532            min_load_start, max_load_start, (min_load_start+max_load_start) / 2, max_load_start-min_load_start);
533      PRINTF(" - LOAD_END   : min = %d / max = %d / med = %d / delta = %d\n",
534            min_load_ended, max_load_ended, (min_load_ended+max_load_ended) / 2, max_load_ended-min_load_ended);
535
536      PRINTF(" - HORI_START : min = %d / max = %d / med = %d / delta = %d\n",
537            min_hori_start, max_hori_start, (min_hori_start+max_hori_start) / 2, max_hori_start-min_hori_start);
538      PRINTF(" - HORI_END   : min = %d / max = %d / med = %d / delta = %d\n",
539            min_hori_ended, max_hori_ended, (min_hori_ended+max_hori_ended) / 2, max_hori_ended-min_hori_ended);
540
541      PRINTF(" - VERT_START : min = %d / max = %d / med = %d / delta = %d\n",
542            min_vert_start, max_vert_start, (min_vert_start+max_vert_start) / 2, max_vert_start-min_vert_start);
543      PRINTF(" - VERT_END   : min = %d / max = %d / med = %d / delta = %d\n",
544            min_vert_ended, max_vert_ended, (min_vert_ended+max_vert_ended) / 2, max_vert_ended-min_vert_ended);
545
546      PRINTF(" - DISP_START : min = %d / max = %d / med = %d / delta = %d\n",
547            min_disp_start, max_disp_start, (min_disp_start+max_disp_start) / 2, max_disp_start-min_disp_start);
548      PRINTF(" - DISP_END   : min = %d / max = %d / med = %d / delta = %d\n",
549            min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended) / 2, max_disp_ended-min_disp_ended);
550
551      PRINTF(" - BARRIER LOAD/HORI = %d\n", min_hori_start - max_load_ended);
552      PRINTF(" - BARRIER HORI/VERT = %d\n", min_vert_start - max_hori_ended);
553      PRINTF(" - BARRIER VERT/DISP = %d\n", min_disp_start - max_vert_ended);
554
555      PRINTF(" - LOAD              = %d\n", max_load_ended);
556      PRINTF(" - FILTER            = %d\n", max_vert_ended - max_load_ended);
557      PRINTF(" - DISPLAY           = %d\n", max_disp_ended - max_vert_ended);
558
559      PRINTF("\nBEGIN LOAD_START\n");
560      for (cc = 0; cc < nclusters; cc++){
561         for (pp = 0; pp < nlocal_procs; pp++){
562            PRINTF("cluster= %d proc= %d date= %d\n", cc, pp, LOAD_START[cc][pp]); 
563         }
564      }
565      PRINTF("END\n");
566
567      PRINTF("\nBEGIN LOAD_END\n");
568      for (cc = 0; cc < nclusters; cc++){
569         for (pp = 0; pp < nlocal_procs; pp++){
570            PRINTF("cluster= %d proc= %d date= %d\n", cc, pp, LOAD_END[cc][pp]); 
571         }
572      }
573      PRINTF("END\n");
574
575      PRINTF("\nBEGIN HORI_START\n");
576      for (cc = 0; cc < nclusters; cc++){
577         for (pp = 0; pp < nlocal_procs; pp++){
578            PRINTF("cluster= %d proc= %d date= %d\n", cc, pp, HORI_START[cc][pp]); 
579         }
580      }
581      PRINTF("END\n");
582
583      PRINTF("\nBEGIN HORI_END\n");
584      for (cc = 0; cc < nclusters; cc++){
585         for (pp = 0; pp < nlocal_procs; pp++){
586            PRINTF("cluster= %d proc= %d date= %d\n", cc, pp, HORI_END[cc][pp]); 
587         }
588      }
589      PRINTF("END\n");
590
591      PRINTF("\nBEGIN VERT_START\n");
592      for (cc = 0; cc < nclusters; cc++){
593         for (pp = 0; pp < nlocal_procs; pp++){
594            PRINTF("cluster= %d proc= %d date= %d\n", cc, pp, VERT_START[cc][pp]); 
595         }
596      }
597      PRINTF("END\n");
598
599      PRINTF("\nBEGIN VERT_END\n");
600      for (cc = 0; cc < nclusters; cc++){
601         for (pp = 0; pp < nlocal_procs; pp++ ){
602            PRINTF("cluster= %d proc= %d date= %d\n", cc, pp, VERT_END[cc][pp]); 
603         }
604      }
605      PRINTF("END\n");
606
607      PRINTF("\nBEGIN DISP_START\n");
608      for (cc = 0; cc < nclusters; cc++){
609         for (pp = 0; pp < nlocal_procs; pp++){
610            PRINTF("cluster= %d proc= %d date= %d\n", cc, pp, DISP_START[cc][pp]); 
611         }
612      }
613      PRINTF("END\n");
614
615      PRINTF("\nBEGIN DISP_END\n");
616      for (cc = 0; cc < nclusters; cc++){
617         for (pp = 0; pp < nlocal_procs; pp++){
618            PRINTF("cluster= %d proc= %d date= %d\n", cc, pp, DISP_END[cc][pp]); 
619         }
620      }
621      PRINTF("END\n");
622   }
623
624   while(1);
625
[158]626} // end main()
627
[248]628// Local Variables:
629// tab-width: 3
630// c-basic-offset: 3
631// c-file-offsets:((innamespace . 0)(inline-open . 0))
632// indent-tabs-mode: nil
633// End:
634
635// vim: filetype=cpp:expandtab:shiftwidth=3:tabstop=3:softtabstop=3
636
637
Note: See TracBrowser for help on using the repository browser.