Index: trunk/softs/soft_filter_giet/main.c
===================================================================
--- trunk/softs/soft_filter_giet/main.c	(revision 162)
+++ trunk/softs/soft_filter_giet/main.c	(revision 170)
@@ -146,4 +146,16 @@
     unsigned char*	Z[256];
     
+    // Arrays of pointers on the instrumentation arrays
+    // These arrays are indexed by the cluster index (sized for the worst case : 256 clusters)
+    // each pointer points on the base adress of an array of 4 (NPROCS max) unsigned int
+    unsigned int*       LOAD_START[256];
+    unsigned int*       LOAD_ENDED[256];
+    unsigned int*       VERT_START[256];
+    unsigned int*       VERT_ENDED[256];
+    unsigned int*       HORI_START[256];
+    unsigned int*       HORI_ENDED[256];
+    unsigned int*       DISP_START[256];
+    unsigned int*       DISP_ENDED[256];
+
     // The shared, distributed buffers addresses are computed
     // from the seg_heap_base value defined in the ldscript file
@@ -153,9 +165,18 @@
     for( c=0 ; c<nclusters ; c++)
     {
-        A[c] = (unsigned short*)(base 				+ increment*c);
-        Z[c] = (unsigned char*)	(base + 2*NP*NL/nclusters 	+ increment*c);
-        B[c] = (int*)		(base + 4*NP*NL/nclusters 	+ increment*c);
-        C[c] = (int*)		(base + 8*NP*NL/nclusters 	+ increment*c);
-        D[c] = (int*)		(base + 12*NP*NL/nclusters 	+ increment*c);
+        A[c] = (unsigned short*)	(base 				+ increment*c);
+        Z[c] = (unsigned char*)		(base + 2*NP*NL/nclusters 	+ increment*c);
+        B[c] = (int*)			(base + 4*NP*NL/nclusters 	+ increment*c);
+        C[c] = (int*)			(base + 8*NP*NL/nclusters 	+ increment*c);
+        D[c] = (int*)			(base + 12*NP*NL/nclusters 	+ increment*c);
+
+        LOAD_START[c] = (unsigned int*) (base + 3*NL*NP/nclusters 	+ increment*c);
+        LOAD_ENDED[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 16	+ increment*c);
+        VERT_START[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 32	+ increment*c);
+        VERT_ENDED[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 48	+ increment*c);
+        HORI_START[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 64	+ increment*c);
+        HORI_ENDED[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 80	+ increment*c);
+        DISP_START[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 96	+ increment*c);
+        DISP_ENDED[c] = (unsigned int*) (base + 3*NL*NP/nclusters + 112	+ increment*c);
     }
 
@@ -169,4 +190,5 @@
     barrier_init(1, ntasks);
     barrier_init(2, ntasks);
+    barrier_init(3, ntasks);
 
     PRINTF("*** Completing barrier init at cycle %d ***\n", proctime());
@@ -179,7 +201,9 @@
     if ( lid == 0 )
     {
+        int p;
         delta = proctime() - date;
         date  = date + delta;
         PRINTF("\n*** Starting load at cycle %d (%d)\n", date, delta);
+        for ( p=0 ; p<nprocs ; p++ ) LOAD_START[cid][p] = date;
 
         if( ioc_read(nblocks*cid/nclusters, 
@@ -199,4 +223,5 @@
         date  = date + delta;
         PRINTF("*** Completing load at cycle %d (%d)\n", date, delta);
+        for ( p=0 ; p<nprocs ; p++ ) LOAD_ENDED[cid][p] = date;
     }
 
@@ -215,4 +240,5 @@
     date  = date + delta;
     PRINTF("\n*** Starting horizontal filter at cycle %d (%d)\n", date, delta);
+    HORI_START[cid][lid] = date;
 
     // l = absolute line index / p = absolute pixel index  
@@ -272,4 +298,5 @@
     date  = date + delta;
     PRINTF("*** Completing horizontal filter at cycle %d (%d)\n", date, delta);
+    HORI_ENDED[cid][lid] = date;
 
     barrier_wait(1);
@@ -286,4 +313,5 @@
     date  = date + delta;
     PRINTF("\n*** starting vertical filter at cycle %d (%d)\n", date, delta);
+    VERT_START[cid][lid] = date;
 
     // l = absolute line index / p = absolute pixel index
@@ -361,4 +389,5 @@
     date  = date + delta;
     PRINTF("*** Completing vertical filter at cycle %d (%d)\n", date, delta);
+    VERT_ENDED[cid][lid] = date;
 
     barrier_wait(2);
@@ -374,4 +403,5 @@
     date  = date + delta;
     PRINTF("\n*** Starting display at cycle %d (%d)\n", date, delta);
+    DISP_START[cid][lid] = date;
 
     first = lid*lines_per_task;
@@ -390,4 +420,83 @@
     date  = date + delta;
     PRINTF("*** Completing display at cycle %d (%d)\n", date, delta);
+    DISP_ENDED[cid][lid] = date;
+
+    barrier_wait(3);
+
+    PRINTF("\n*** Starting Instrumentation at cycle %d (%d)\n\n", date, delta);
+
+    // Instrumentation (done by processor 0 in all clusters)
+    int cc, pp;
+    unsigned int min_load_start = 1000000000;
+    unsigned int max_load_start = 0;
+    unsigned int min_load_ended = 1000000000;
+    unsigned int max_load_ended = 0;
+
+    unsigned int min_hori_start = 1000000000;
+    unsigned int max_hori_start = 0;
+    unsigned int min_hori_ended = 1000000000;
+    unsigned int max_hori_ended = 0;
+
+    unsigned int min_vert_start = 1000000000;
+    unsigned int max_vert_start = 0;
+    unsigned int min_vert_ended = 1000000000;
+    unsigned int max_vert_ended = 0;
+
+    unsigned int min_disp_start = 1000000000;
+    unsigned int max_disp_start = 0;
+    unsigned int min_disp_ended = 1000000000;
+    unsigned int max_disp_ended = 0;
+
+    if ( lid == 0 )
+    {
+        for ( cc=0 ; cc<nclusters ; cc++ )
+        {
+            for ( pp=0 ; pp<nprocs ; pp++ )
+            {
+                if ( LOAD_START[cc][pp] < min_load_start ) min_load_start = LOAD_START[cc][pp];
+                if ( LOAD_START[cc][pp] > max_load_start ) max_load_start = LOAD_START[cc][pp];
+                if ( LOAD_ENDED[cc][pp] < min_load_ended ) min_load_ended = LOAD_ENDED[cc][pp];
+                if ( LOAD_ENDED[cc][pp] > max_load_ended ) max_load_ended = LOAD_ENDED[cc][pp];
+
+                if ( HORI_START[cc][pp] < min_hori_start ) min_hori_start = HORI_START[cc][pp];
+                if ( HORI_START[cc][pp] > max_hori_start ) max_hori_start = HORI_START[cc][pp];
+                if ( HORI_ENDED[cc][pp] < min_hori_ended ) min_hori_ended = HORI_ENDED[cc][pp];
+                if ( HORI_ENDED[cc][pp] > max_hori_ended ) max_hori_ended = HORI_ENDED[cc][pp];
+
+                if ( VERT_START[cc][pp] < min_vert_start ) min_vert_start = VERT_START[cc][pp];
+                if ( VERT_START[cc][pp] > max_vert_start ) max_vert_start = VERT_START[cc][pp];
+                if ( VERT_ENDED[cc][pp] < min_vert_ended ) min_vert_ended = VERT_ENDED[cc][pp];
+                if ( VERT_ENDED[cc][pp] > max_vert_ended ) max_vert_ended = VERT_ENDED[cc][pp];
+
+                if ( DISP_START[cc][pp] < min_disp_start ) min_disp_start = DISP_START[cc][pp];
+                if ( DISP_START[cc][pp] > max_disp_start ) max_disp_start = DISP_START[cc][pp];
+                if ( DISP_ENDED[cc][pp] < min_disp_ended ) min_disp_ended = DISP_ENDED[cc][pp];
+                if ( DISP_ENDED[cc][pp] > max_disp_ended ) max_disp_ended = DISP_ENDED[cc][pp];
+            }
+        }
+    }
+    PRINTF(" - LOAD_START : min = %d / max = %d / med = %d / delta = %d\n",
+    min_load_start, max_load_start, (min_load_start+max_load_start)/2, max_load_start-min_load_start);
+    PRINTF(" - LOAD_END   : min = %d / max = %d / med = %d / delta = %d\n",
+    min_load_ended, max_load_ended, (min_load_ended+max_load_ended)/2, max_load_ended-min_load_ended);
+
+    PRINTF(" - HORI_START : min = %d / max = %d / med = %d / delta = %d\n",
+    min_hori_start, max_hori_start, (min_hori_start+max_hori_start)/2, max_hori_start-min_hori_start);
+    PRINTF(" - HORI_END   : min = %d / max = %d / med = %d / delta = %d\n",
+    min_hori_ended, max_hori_ended, (min_hori_ended+max_hori_ended)/2, max_hori_ended-min_hori_ended);
+
+    PRINTF(" - VERT_START : min = %d / max = %d / med = %d / delta = %d\n",
+    min_vert_start, max_vert_start, (min_vert_start+max_vert_start)/2, max_vert_start-min_vert_start);
+    PRINTF(" - VERT_END   : min = %d / max = %d / med = %d / delta = %d\n",
+    min_vert_ended, max_vert_ended, (min_vert_ended+max_vert_ended)/2, max_vert_ended-min_vert_ended);
+
+    PRINTF(" - DISP_START : min = %d / max = %d / med = %d / delta = %d\n",
+    min_disp_start, max_disp_start, (min_disp_start+max_disp_start)/2, max_disp_start-min_disp_start);
+    PRINTF(" - DISP_END   : min = %d / max = %d / med = %d / delta = %d\n",
+    min_disp_ended, max_disp_ended, (min_disp_ended+max_disp_ended)/2, max_disp_ended-min_disp_ended);
+
+    PRINTF(" - BARRIER LOAD/HORI = %d\n", min_hori_start - max_load_ended);
+    PRINTF(" - BARRIER HORI/VERT = %d\n", min_vert_start - max_hori_ended);
+    PRINTF(" - BARRIER VERT/DISP = %d\n", min_disp_start - max_vert_ended);
 
     while(1);
