Index: /trunk/platforms/tsar_generic_xbar/scripts/counter_defs.py
===================================================================
--- /trunk/platforms/tsar_generic_xbar/scripts/counter_defs.py	(revision 748)
+++ /trunk/platforms/tsar_generic_xbar/scripts/counter_defs.py	(revision 749)
@@ -1,5 +1,7 @@
 
 individual_metrics = [ 'req_trig_update', 'local_update', 'remote_update', 'update_cost', 'req_trig_m_inv', 'local_m_inv', 'remote_m_inv', 'm_inv_cost', 'broadcast', 'total_update', 'total_m_inv' ]
+
 grouped_metrics = [ 'update_cost', 'm_inv_cost' ]
+
 stacked_metrics = [ 'nonwrite_broadcast', 'write_broadcast', 'local_m_inv', 'remote_m_inv', 'local_update', 'remote_update' ]
 
@@ -10,4 +12,6 @@
 m_app_name['histogram'] = "Histogram"
 m_app_name['kmeans'] = "Kmeans"
+m_app_name['pca'] = "PCA"
+m_app_name['mat_mult'] = "Matrix Mult."
 m_app_name['barnes'] = "Barnes"
 m_app_name['fmm'] = "FMM"
Index: /trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py
===================================================================
--- /trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py	(revision 748)
+++ /trunk/platforms/tsar_generic_xbar/scripts/create_graphs.py	(revision 749)
@@ -7,5 +7,5 @@
 
 
-apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga', 'kmeans' ]
+apps = [ 'histogram', 'mandel', 'filter', 'radix', 'radix_ga', 'fft', 'fft_ga', 'filt_ga', 'kmeans', 'pca', 'lu' ]
 nb_procs = [ 1, 4, 8, 16, 32, 64, 128, 256 ]
 
@@ -82,5 +82,5 @@
       for line in lines:
          tokens = line[:-1].split()
-         if len(tokens) > 0 and tokens[0] == "[ELAPSED2]":
+         if len(tokens) > 0 and tokens[0] == "[PARALLEL_COMPUTE]":
             exec_time[app][i] = int(tokens[len(tokens) - 1])
 
@@ -139,5 +139,4 @@
 
 for app in apps:
-    
    data_coherence_name = os.path.join(scripts_path, gen_dir, app + '_coherence.dat')
    gp_coherence_name   = os.path.join(scripts_path, gen_dir, app + '_coherence.gp')
Index: /trunk/platforms/tsar_generic_xbar/scripts/run_simus.py
===================================================================
--- /trunk/platforms/tsar_generic_xbar/scripts/run_simus.py	(revision 748)
+++ /trunk/platforms/tsar_generic_xbar/scripts/run_simus.py	(revision 749)
@@ -20,10 +20,10 @@
 #apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga', 'kmeans' ]
 #apps = [ 'histogram', 'mandel', 'filter', 'radix_ga', 'fft_ga' ]
-apps = [ 'filt_ga' ]
-
-
-all_apps = [ 'mandel', 'filter', 'filt_ga', 'histogram', 'kmeans', 'barnes', 'fmm', 'ocean', 'raytrace', 'radiosity', 'waters', 'watern', 'cholesky', 'lu', 'fft', 'radix', 'fft_ga', 'radix_ga', 'kmeans' ]
-splash2 = [ 'barnes', 'fmm', 'ocean', 'radiosity', 'raytrace', 'watern', 'waters', 'cholesky', 'lu', 'fft', 'radix' ]
-splash2_ga = [ 'radix_ga', 'fft_ga' ]
+
+
+all_apps = [ 'cholesky', 'fft', 'fft_ga', 'filter', 'filt_ga', 'histogram', 'kmeans', 'lu', 'mandel', 'mat_mult', 'pca', 'radix', 'radix_ga', 'showimg', ]
+# to come: 'barnes', 'fmm', 'ocean', 'raytrace', 'radiosity', 'waters', 'watern'
+
+apps = [ 'histogram', 'pca' ]
 
 
@@ -44,7 +44,4 @@
 top_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")
 
-splash2_dir    = os.path.join(apps_dir, 'splash2/codes')
-splash2_ga_dir = os.path.join(apps_dir, 'splash2_ga')
-
 scripts_path       = os.path.join(top_path, 'scripts')
 almos_path         = os.path.join(top_path, 'almos')
@@ -58,22 +55,22 @@
 
 
-splash_app_dir = {}
-splash_app_dir['barnes'] = 'apps/barnes'
-splash_app_dir['fmm'] = 'apps/fmm'
-splash_app_dir['ocean'] = 'apps/ocean/contiguous_partitions'
-splash_app_dir['raytrace'] = 'apps/raytrace'
-splash_app_dir['radiosity'] = 'apps/radiosity'
+#splash_app_dir = {}
+#splash_app_dir['barnes'] = 'apps/barnes'
+#splash_app_dir['fmm'] = 'apps/fmm'
+#splash_app_dir['ocean'] = 'apps/ocean/contiguous_partitions'
+#splash_app_dir['raytrace'] = 'apps/raytrace'
+#splash_app_dir['radiosity'] = 'apps/radiosity'
 #splash_app_dir['volrend'] = 'apps/volrend'
-splash_app_dir['watern'] = 'apps/water-nsquared'
-splash_app_dir['waters'] = 'apps/water-spatial'
-
-splash_app_dir['cholesky'] = 'kernels/cholesky'
-splash_app_dir['fft'] = 'kernels/fft'
-splash_app_dir['lu'] = 'kernels/lu/contiguous_blocks'
-splash_app_dir['radix'] = 'kernels/radix'
-
-splash_ga_app_dir = {}
-splash_ga_app_dir['radix_ga'] = 'apps/radix'
-splash_ga_app_dir['fft_ga'] = 'apps/fft'
+#splash_app_dir['watern'] = 'apps/water-nsquared'
+#splash_app_dir['waters'] = 'apps/water-spatial'
+#
+#splash_app_dir['cholesky'] = 'kernels/cholesky'
+#splash_app_dir['fft'] = 'kernels/fft'
+#splash_app_dir['lu'] = 'kernels/lu/contiguous_blocks'
+#splash_app_dir['radix'] = 'kernels/radix'
+#
+#splash_ga_app_dir = {}
+#splash_ga_app_dir['radix_ga'] = 'apps/radix'
+#splash_ga_app_dir['fft_ga'] = 'apps/fft'
 
 
@@ -170,10 +167,13 @@
 def compile_app(app_name, nprocs):
 
-   if app_name in splash2:
-      app_dir_name = os.path.join(splash2_dir, splash_app_dir[app_name])
-   elif app_name in splash2_ga:
-      app_dir_name = os.path.join(splash2_ga_dir, splash_ga_app_dir[app_name])
-   else:
-      app_dir_name = os.path.join(apps_dir, app_name)
+   #if app_name in splash2:
+   #   app_dir_name = os.path.join(splash2_dir, splash_app_dir[app_name])
+   #elif app_name in splash2_ga:
+   #   app_dir_name = os.path.join(splash2_ga_dir, splash_ga_app_dir[app_name])
+   #else:
+   #   app_dir_name = os.path.join(apps_dir, app_name)
+
+     
+   app_dir_name = os.path.join(apps_dir, app_name)
 
    old_path = os.getcwd()
@@ -182,30 +182,36 @@
 
    # Compilation process is different in splash and other apps
-   if app_name in splash2:
-      print "make clean"
-      subprocess.call([ 'make', 'clean' ])
-
-      print "rm Makefile"
-      subprocess.call([ 'rm', 'Makefile' ])
-
-      print "ln -s Makefile.soclib Makefile"
-      subprocess.call([ 'ln', '-s', 'Makefile.soclib', 'Makefile' ])
-
-      print "make"
-      subprocess.call([ 'make' ])
-
-   elif app_name in splash2_ga:
-      print "make clean"
-      subprocess.call([ 'make', 'clean' ])
-
-      print "make"
-      subprocess.call([ 'make' ])
-
-   else:
-      print "make clean"
-      subprocess.call([ 'make', 'clean' ])
+   #if app_name in splash2:
+   #   print "make clean"
+   #   subprocess.call([ 'make', 'clean' ])
+
+   #   print "rm Makefile"
+   #   subprocess.call([ 'rm', 'Makefile' ])
+
+   #   print "ln -s Makefile.soclib Makefile"
+   #   subprocess.call([ 'ln', '-s', 'Makefile.soclib', 'Makefile' ])
+
+   #   print "make"
+   #   subprocess.call([ 'make' ])
+
+   #elif app_name in splash2_ga:
+   #   print "make clean"
+   #   subprocess.call([ 'make', 'clean' ])
+
+   #   print "make"
+   #   subprocess.call([ 'make' ])
+
+   #else:
+   #   print "make clean"
+   #   subprocess.call([ 'make', 'clean' ])
  
-      print "make TARGET=tsar"
-      subprocess.call([ 'make', 'TARGET=tsar' ])
+   #   print "make TARGET=tsar"
+   #   subprocess.call([ 'make', 'TARGET=tsar' ])
+
+   print "make clean"
+   subprocess.call([ 'make', 'clean' ])
+ 
+   print "make TARGET=tsar"
+   subprocess.call([ 'make', 'TARGET=tsar' ])
    
    # Creation/Modification du shrc de almos
@@ -215,5 +221,4 @@
       shrc = "exec -p 0 /bin/mandel -n%(nproc)d\n" % dict(nproc = nprocs)
    elif (app_name == "filter"):
-      #shrc = "exec -p 0 /bin/filter /etc/imgs.raw 512 512\n"
       shrc = "exec -p 0 /bin/filter -l1024 -c1024 -n%(nproc)d /etc/img.raw\n" % dict(nproc = nprocs)
    elif (app_name == "filt_ga"):
@@ -223,6 +228,10 @@
    elif (app_name == "kmeans"):
       shrc = "exec -p 0 /bin/kmeans -n %(nproc)d -p %(npoints)d\n" % dict(nproc = nprocs, npoints = 10000) # default npoints = 100000
+   elif (app_name == "pca"):
+      shrc = "exec -p 0 /bin/pca -n%(nproc)d\n" % dict(nproc = nprocs)
+   elif (app_name == "mat_mult"):
+      shrc = "exec -p 0 /bin/mat_mult -n%(nproc)d\n" % dict(nproc = nprocs)
    elif (app_name == "showimg"):
-      shrc = "exec -p 0 /bin/showimg -p1 -i /etc/lena.sgi -o /dev/fb0\n"
+      shrc = "exec -p 0 /bin/showimg -i /etc/lena.sgi\n"
    elif (app_name == "barnes"):
       shrc = "exec -p 0 /bin/barnes -n%(nproc)d -b%(nbody)d\n" % dict(nproc = nprocs, nbody = 1024)
@@ -242,13 +251,13 @@
       shrc = "exec -p 0 /bin/cholesky -n%(nproc)d /etc/tk14.O\n" % dict(nproc = nprocs)
    elif (app_name == "fft"):
-      shrc = "exec -p 0 /bin/fft -n%(nproc)d -m10\n" % dict(nproc = nprocs)
+      shrc = "exec -p 0 /bin/fft -n%(nproc)d -m18\n" % dict(nproc = nprocs)
    elif (app_name == "lu"):
       shrc = "exec -p 0 /bin/lu -n%(nproc)d -m512\n" % dict(nproc = nprocs)
    elif (app_name == "radix"):
-      shrc = "exec -p 0 /bin/radix -n%(nproc)d -k1024\n" % dict(nproc = nprocs) # test : 1024 ; simu : 65536
+      shrc = "exec -p 0 /bin/radix -n%(nproc)d -k2097152\n" % dict(nproc = nprocs) # test : 1024 ; simu : 2097152
    elif (app_name == "radix_ga"):
-      shrc = "exec -p 0 /bin/radix_ga -p%(nproc)d -n262144\n" % dict(nproc = nprocs) # p = proc, n = num_keys
+      shrc = "exec -p 0 /bin/radix_ga -n%(nproc)d -k2097152\n" % dict(nproc = nprocs) # p = proc, n = num_keys
    elif (app_name == "fft_ga"):
-      shrc = "exec -p 0 /bin/fft_ga -P%(nproc)d -M16\n" % dict(nproc = nprocs)
+      shrc = "exec -p 0 /bin/fft_ga -n%(nproc)d -m18\n" % dict(nproc = nprocs)
    else:
       assert(False)
@@ -318,8 +327,8 @@
          end_found = False
          for line in open(filename):
-            if "[START2]" in line:
+            if "[THREAD_COMPUTE_START]" in line:
                start2 = line.split()[-1]
                start2_found = True
-            if "[END]" in line:
+            if "[THREAD_COMPUTE_END]" in line:
                end = line.split()[-1]
                end_found = True
Index: /trunk/platforms/tsar_generic_xbar/scripts/templates/speedup_template.gp
===================================================================
--- /trunk/platforms/tsar_generic_xbar/scripts/templates/speedup_template.gp	(revision 748)
+++ /trunk/platforms/tsar_generic_xbar/scripts/templates/speedup_template.gp	(revision 749)
@@ -1,4 +1,4 @@
 
-set terminal svg size 500 400 fixed
+set terminal svg size 1000 800 fixed
 set output "%(svg_name)s.svg"
 
Index: /trunk/platforms/tsar_generic_xbar/top.cpp
===================================================================
--- /trunk/platforms/tsar_generic_xbar/top.cpp	(revision 748)
+++ /trunk/platforms/tsar_generic_xbar/top.cpp	(revision 749)
@@ -1034,10 +1034,10 @@
    else {
       int64_t n = 0;
-      while (!stop_called) {
+      while (!stop_called && n != ncycles) {
          if (gettimeofday(&t1, NULL) != 0) {
             perror("gettimeofday");
             return EXIT_FAILURE;
          }
-         int64_t nb_cycles = max_cycles;
+         int64_t nb_cycles = min(max_cycles, ncycles - n);
          if (do_reset_counters) {
             nb_cycles = min(nb_cycles, reset_counters - n);
