Index: trunk/softs/soft_transpose_giet/main.c
===================================================================
--- trunk/softs/soft_transpose_giet/main.c	(revision 629)
+++ trunk/softs/soft_transpose_giet/main.c	(revision 631)
@@ -8,10 +8,13 @@
 #define NP              128
 #define NB_IMAGES       5
-
+ 
+// Only processor 0 in each cluster access TTY
 #define PRINTF(...)      ({ if (lpid == 0) { _tty_printf(__VA_ARGS__); } })
 
-#define DISPLAY_OK
-
-// tricks to read parameters from ldscript
+#define DISPLAY_OK          1   // enable display on frame buffer when non zero 
+#define CHECK_VERBOSE       1   // display a detailed check on TTY  when non zero
+#define INSTRUMENTATION_OK  0   // display statistcs on TTY when non zero
+
+// tricks to read some addresses from ldscript
 extern struct plaf seg_ioc_base;
 extern struct plaf seg_heap_base;
@@ -19,5 +22,5 @@
 // global variables stored in seg_data (cluster 0)
 
-// instrumentation counters for each processor
+// instrumentation counters (for each processor)
 unsigned int LOAD_START[256][4];
 unsigned int LOAD_END  [256][4];
@@ -27,5 +30,5 @@
 unsigned int DISP_END  [256][4];
 
-// checksum variables
+// checksum variables (used by proc(0,0,0) only
 unsigned check_line_before[NL];
 unsigned check_line_after[NL];
@@ -58,5 +61,5 @@
     unsigned int cluster_id  = (x * Y_SIZE) + y;               
 
-    PRINTF("\n *** Proc 0 in cluster [%d,%d] enters main at cycle %d ***\n\n", 
+    PRINTF("\n *** Proc [%d,%d,0] enters main at cycle %d ***\n\n", 
            x, y, _proctime());
 
@@ -96,5 +99,5 @@
    _barrier_init(3, ntasks);
 
-   PRINTF("*** Proc 0 in cluster [%d,%d] completes barrier init at cycle %d\n",
+   PRINTF("*** Proc [%d,%d,0] completes barrier init at cycle %d\n",
           x, y, _proctime());
 
@@ -109,4 +112,7 @@
       if (lpid == 0)
       {
+         PRINTF("\n*** Proc [%d,%d,0] starts load for image %d at cycle %d\n",
+                x, y, image, _proctime() );
+
          _ioc_read( ((image * nblocks) + ((nblocks * cluster_id) / nclusters)), 
                     buf_in,
@@ -114,10 +120,7 @@
                     cluster_xy );
 
-         PRINTF("\n*** Proc 0 in cluster [%d,%d] starts load for image %d at cycle %d\n",
-                x, y, image, _proctime() );
-
          _ioc_completed();
 
-         PRINTF("*** Proc 0 in cluster [%d,%d] completes load for image %d at cycle %d\n",
+         PRINTF("*** Proc [%d,%d,0] completes load for image %d at cycle %d\n",
                 x, y, image, _proctime() );
       }
@@ -131,5 +134,5 @@
       // (p,l) are the pixel coordinates in the source image
 
-      PRINTF("\n*** proc 0 in cluster [%d,%d] starts transpose for image %d at cycle %d\n", 
+      PRINTF("\n*** proc [%d,%d,0] starts transpose for image %d at cycle %d\n", 
              x, y, image, _proctime());
 
@@ -203,5 +206,5 @@
       }
 
-      PRINTF("*** proc 0 in cluster [%d,%d] complete transpose for image %d at cycle %d\n", 
+      PRINTF("*** proc [%d,%d,0] complete transpose for image %d at cycle %d\n", 
              x, y, image, _proctime() );
 
@@ -212,34 +215,36 @@
       // optional parallel display from local buf_out to frame buffer
 
-#ifdef DISPLAY_OK
-
-      PRINTF("\n*** proc 0 in cluster [%d,%d] starts display for image %d at cycle %d\n", 
-             x, y, image, _proctime() );
-
-      DISP_START[cluster_id][lpid] = _proctime();
-
-      unsigned int npxt = npixels / ntasks;   // number of pixels per task
-      unsigned int buffer = (unsigned int)buf_out + npxt*lpid;
-
-      _fb_sync_write( npxt * task_id, buffer, npxt, cluster_xy );
-
-      PRINTF("*** Proc 0 in cluster [%d,%d] completes display for image %d at cycle %d\n",
-             x, y, image, _proctime() );
-
-      DISP_END[cluster_id][lpid] = _proctime();
-
-      _barrier_wait(2);
-
-#endif
-
-      // Instrumentation and checksum (done by processor 0 in cluster 0)
-      if (proc_id == 0)
-      { 
-         PRINTF("\n*** Proc [0,0,0] starts checks for image %d at cycle %d\n\n",
-                  image, _proctime() );
+      if ( DISPLAY_OK )
+      {
+          PRINTF("\n*** proc [%d,%d,0] starts display for image %d at cycle %d\n", 
+                 x, y, image, _proctime() );
+
+          DISP_START[cluster_id][lpid] = _proctime();
+
+          unsigned int npxt = npixels / ntasks;   // number of pixels per task
+          unsigned int buffer = (unsigned int)buf_out + npxt*lpid;
+
+          _fb_sync_write( npxt * task_id, buffer, npxt, cluster_xy );
+
+          PRINTF("*** Proc [%d,%d,0] completes display for image %d at cycle %d\n",
+                 x, y, image, _proctime() );
+
+          DISP_END[cluster_id][lpid] = _proctime();
+
+          _barrier_wait(2);
+      }
+
+      // checksum (done by processor 0 in each cluster)
+
+      if ( lpid == 0 )
+      {
+         PRINTF("\n*** Proc [%d,%d,0] starts checks for image %d at cycle %d\n\n",
+                x, y, image, _proctime() );
 
          unsigned int success = 1;
-
-         for ( l = 0 ; l < NL ; l++ )
+         unsigned int start   = cluster_id * (NL / nclusters);
+         unsigned int stop    = start + (NL / nclusters);
+
+         for ( l = start ; l < stop ; l++ )
          {
             check_line_after[l] = 0;
@@ -258,13 +263,21 @@
             }
 
-            PRINTF(" - l = %d / before = %d / after = %d \n",
-                   l, check_line_before[l], check_line_after[l] );
+            if( CHECK_VERBOSE )
+            {
+                PRINTF(" - l = %d / before = %d / after = %d \n",
+                       l, check_line_before[l], check_line_after[l] );
+            }
 
             if ( check_line_before[l] != check_line_after[l] ) success = 0;
          }
 
-         if ( success ) PRINTF("\n*** proc [0,0,0] : CHECKSUM OK \n\n");
-         else           PRINTF("\n*** proc [0,0,0] : CHECKSUM KO \n\n");
-
+         if ( success ) PRINTF("\n*** proc [%d,%d,0] : CHECKSUM OK \n\n", x, y);
+         else           PRINTF("\n*** proc [%d,%d,0] : CHECKSUM KO \n\n", x, y);
+      }
+
+      // instrumentation ( done by processor [0,0,0]
+
+      if ( (proc_id == 0) && INSTRUMENTATION_OK )
+      {
          int cc, pp;
          unsigned int min_load_start = INT_MAX;
