Index: trunk/ArchTOIPipe/TestPipes/mesovh2.cc
===================================================================
--- trunk/ArchTOIPipe/TestPipes/mesovh2.cc	(revision 2031)
+++ trunk/ArchTOIPipe/TestPipes/mesovh2.cc	(revision 2033)
@@ -3,5 +3,5 @@
 //                               Christophe Magneville
 //                               Reza Ansari
-// $Id: mesovh2.cc,v 1.2 2002-05-14 13:06:58 ansari Exp $
+// $Id: mesovh2.cc,v 1.3 2002-05-30 20:44:31 ansari Exp $
 /*   mesure de performance de l'architecture
 
@@ -32,5 +32,7 @@
   else {
     cout << "\n Usage : mesovh2 [-dbg] [-start snb] [-end sne] \n" 
-	 << "         [-intoi name] [-wtoi sz] [-wnoop sz] [-bipro] \n"
+	 << "         [-intoi name] [-wtoi sz] [-wnoop sz] \n"
+	 << "         [-bipro sz2] [-tripro sz2,sz3] [-quadpro sz2,sz3,sz4] \n"
+	 << "         [-pentapro sz2,sz3,sz4,sz5] [-hexapro sz2,sz3,sz4,sz5,sz6] \n"
          << "         [-intoi2 name] [-prstat] [-useseqbuff] inFitsName \n"
 	 << "   -dbg : sets CGT class debug level to 1 \n"
@@ -41,5 +43,6 @@
 	 << "   -wtoi sz : sets TOISeqBuff/TOISegmented buffer size (def= 1024)\n"
 	 << "   -wnoop sz : sets NoOpProcessor window size \n"
-	 << "   -bipro : chain 2 processors \n"
+	 << "   -bipro sz2: chain 2 processors sz2= NoOpProcessor 2 window size\n"
+	 << "   -tripro -quadpro -pentapro -hexapro ... chain 3-6 processors \n"
 	 << "   -intoi2 toiName : chaine 2 procs with toi2->in2\n"
 	 << "   -prstat : PrintStat with ProcSampleCounter \n"
@@ -57,5 +60,6 @@
 
   // --------- Decoding command line parameters
-  bool fgbipro = false;
+  int  nb_procs = 1;
+  int  proc_wsz[6] = {0,0,0,0,0,0};
   bool fgsetstart = false;
   bool fgprstat = false;
@@ -94,4 +98,31 @@
       wnoop = atoi(arg[ia+1]); ia++;
     }    
+    else if (strcmp(arg[ia],"-bipro") == 0) {
+      if (ia == narg-1) Usage(true);  
+      nb_procs = 2;
+      sscanf(arg[ia+1],"%d",proc_wsz+1); ia++;
+    }    
+    else if (strcmp(arg[ia],"-tripro") == 0) {
+      if (ia == narg-1) Usage(true);  
+      nb_procs = 3;
+      sscanf(arg[ia+1],"%d,%d",proc_wsz+1,proc_wsz+2 ); ia++;
+    }    
+    else if (strcmp(arg[ia],"-quadpro") == 0) {
+      if (ia == narg-1) Usage(true);  
+      nb_procs = 4;
+      sscanf(arg[ia+1],"%d,%d,%d",proc_wsz+1,proc_wsz+2,proc_wsz+3 ); ia++;
+    }    
+    else if (strcmp(arg[ia],"-pentapro") == 0) {
+      if (ia == narg-1) Usage(true);  
+      nb_procs = 5;
+      sscanf(arg[ia+1],"%d,%d,%d,%d",proc_wsz+1,proc_wsz+2,
+	     proc_wsz+3,proc_wsz+4); ia++;
+    }    
+    else if (strcmp(arg[ia],"-pentapro") == 0) {
+      if (ia == narg-1) Usage(true);  
+      nb_procs = 6;
+      sscanf(arg[ia+1],"%d,%d,%d,%d,%d",proc_wsz+1,proc_wsz+2,
+	     proc_wsz+3,proc_wsz+4,proc_wsz+5 ); ia++;
+    }    
     else if (strcmp(arg[ia],"-intoi") == 0) {
       if (ia == narg-1) Usage(true);  
@@ -100,8 +131,7 @@
     else if (strcmp(arg[ia],"-intoi2") == 0) {
       if (ia == narg-1) Usage(true);
-      fgbipro = fgtoi2 = true;
+      fgtoi2 = true;
       intoi2 = arg[ia+1]; ia++;
     }    
-    else if (strcmp(arg[ia],"-bipro") == 0)  fgbipro = true;
     else if (strcmp(arg[ia],"-dbg") == 0)  dbglev = 1;
     else if (strcmp(arg[ia],"-dbg2") == 0)  dbglev = 2;
@@ -133,21 +163,25 @@
 
     FITSTOIReader r(infile); 
-    cout << "> FITSTOIReader reader created" << endl;
-    NoOpProcessor noop(wnoop);
-    NoOpProcessor noop2(wnoop);
-    cout << "> NoOpProcessor noop noop2 created" << endl;
+    cout << "> FITSTOIReader reader created File=" << infile << endl;
+    proc_wsz[0] = wnoop;
+    NoOpProcessor noop[6];
+    int k;
+    for(k=0; k<nb_procs; k++) {
+      noop[k].SetWSize(proc_wsz[k]);
+      cout << "> NoOpProcessor noop[" << k << "]  created WSz=" << proc_wsz[k] << endl;
+    }
     
     cout << "> Connecting to Processors through plombier ... " << endl;
     string inname = "in";
-    plombier.Connect(r, intoi, noop, inname);
+    plombier.Connect(r, intoi, noop[0], inname);
     
     if (fgtoi2) {
       int w2 = (wnoop > 0) ? wtoi+wnoop : wtoi;
       inname = "in2";
-      plombier.Connect(r, intoi2, noop, inname, "", w2);
-    }
-    if (fgbipro) {
-      plombier.Connect(noop, "out", noop2, "in"); 
-      if (fgtoi2) plombier.Connect(noop, "out2", noop2, "in2");
+      plombier.Connect(r, intoi2, noop[0], inname, "", w2);
+    }
+    for(k=1; k<nb_procs; k++) {
+      plombier.Connect(noop[k-1], "out", noop[k], "in"); 
+      if (fgtoi2) plombier.Connect(noop[k-1], "out2", noop[k], "in2");
     }
 
@@ -160,5 +194,5 @@
     if (fgprstat) {
       // --------------- Impression continu de stat -------------------
-      ProcSampleCounter<NoOpProcessor> stats(noop);
+      ProcSampleCounter<NoOpProcessor> stats(noop[0]);
       stats.InfoMessage() = "mesovh2/Info";
       stats.PrintStats();
@@ -170,6 +204,6 @@
     PrtTim("End threads");
 
-    cout << noop ; 
-    if (fgbipro) cout << noop2 ; 
+    cout << noop[0] ; 
+    if (nb_procs > 1) cout << noop[nb_procs-1] ; 
   }
   catch (PThrowable & exc) {
