Changeset 2033 in Sophya


Ignore:
Timestamp:
May 30, 2002, 10:44:31 PM (23 years ago)
Author:
ansari
Message:

amelioration du programme de test mesovh2 - Reza 30/5/2002

Location:
trunk/ArchTOIPipe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Processors/nooppr.h

    r1994 r2033  
    55//                               Christophe Magneville
    66//                               Reza Ansari
    7 // $Id: nooppr.h,v 1.6 2002-05-13 13:11:32 ansari Exp $
     7// $Id: nooppr.h,v 1.7 2002-05-30 20:44:31 ansari Exp $
    88
    99
     
    2323
    2424  inline int    WSize() const { return wsize; }
     25  inline void   SetWSize(int wsz)  { if (wsz > 1)  wsize =  wsz; }
    2526  inline int_8  ProcessedSampleCount() const { return totnscount; }
    2627
  • trunk/ArchTOIPipe/TestPipes/mesovh2.cc

    r2000 r2033  
    33//                               Christophe Magneville
    44//                               Reza Ansari
    5 // $Id: mesovh2.cc,v 1.2 2002-05-14 13:06:58 ansari Exp $
     5// $Id: mesovh2.cc,v 1.3 2002-05-30 20:44:31 ansari Exp $
    66/*   mesure de performance de l'architecture
    77
     
    3232  else {
    3333    cout << "\n Usage : mesovh2 [-dbg] [-start snb] [-end sne] \n"
    34          << "         [-intoi name] [-wtoi sz] [-wnoop sz] [-bipro] \n"
     34         << "         [-intoi name] [-wtoi sz] [-wnoop sz] \n"
     35         << "         [-bipro sz2] [-tripro sz2,sz3] [-quadpro sz2,sz3,sz4] \n"
     36         << "         [-pentapro sz2,sz3,sz4,sz5] [-hexapro sz2,sz3,sz4,sz5,sz6] \n"
    3537         << "         [-intoi2 name] [-prstat] [-useseqbuff] inFitsName \n"
    3638         << "   -dbg : sets CGT class debug level to 1 \n"
     
    4143         << "   -wtoi sz : sets TOISeqBuff/TOISegmented buffer size (def= 1024)\n"
    4244         << "   -wnoop sz : sets NoOpProcessor window size \n"
    43          << "   -bipro : chain 2 processors \n"
     45         << "   -bipro sz2: chain 2 processors sz2= NoOpProcessor 2 window size\n"
     46         << "   -tripro -quadpro -pentapro -hexapro ... chain 3-6 processors \n"
    4447         << "   -intoi2 toiName : chaine 2 procs with toi2->in2\n"
    4548         << "   -prstat : PrintStat with ProcSampleCounter \n"
     
    5760
    5861  // --------- Decoding command line parameters
    59   bool fgbipro = false;
     62  int  nb_procs = 1;
     63  int  proc_wsz[6] = {0,0,0,0,0,0};
    6064  bool fgsetstart = false;
    6165  bool fgprstat = false;
     
    9498      wnoop = atoi(arg[ia+1]); ia++;
    9599    }   
     100    else if (strcmp(arg[ia],"-bipro") == 0) {
     101      if (ia == narg-1) Usage(true); 
     102      nb_procs = 2;
     103      sscanf(arg[ia+1],"%d",proc_wsz+1); ia++;
     104    }   
     105    else if (strcmp(arg[ia],"-tripro") == 0) {
     106      if (ia == narg-1) Usage(true); 
     107      nb_procs = 3;
     108      sscanf(arg[ia+1],"%d,%d",proc_wsz+1,proc_wsz+2 ); ia++;
     109    }   
     110    else if (strcmp(arg[ia],"-quadpro") == 0) {
     111      if (ia == narg-1) Usage(true); 
     112      nb_procs = 4;
     113      sscanf(arg[ia+1],"%d,%d,%d",proc_wsz+1,proc_wsz+2,proc_wsz+3 ); ia++;
     114    }   
     115    else if (strcmp(arg[ia],"-pentapro") == 0) {
     116      if (ia == narg-1) Usage(true); 
     117      nb_procs = 5;
     118      sscanf(arg[ia+1],"%d,%d,%d,%d",proc_wsz+1,proc_wsz+2,
     119             proc_wsz+3,proc_wsz+4); ia++;
     120    }   
     121    else if (strcmp(arg[ia],"-pentapro") == 0) {
     122      if (ia == narg-1) Usage(true); 
     123      nb_procs = 6;
     124      sscanf(arg[ia+1],"%d,%d,%d,%d,%d",proc_wsz+1,proc_wsz+2,
     125             proc_wsz+3,proc_wsz+4,proc_wsz+5 ); ia++;
     126    }   
    96127    else if (strcmp(arg[ia],"-intoi") == 0) {
    97128      if (ia == narg-1) Usage(true); 
     
    100131    else if (strcmp(arg[ia],"-intoi2") == 0) {
    101132      if (ia == narg-1) Usage(true);
    102       fgbipro = fgtoi2 = true;
     133      fgtoi2 = true;
    103134      intoi2 = arg[ia+1]; ia++;
    104135    }   
    105     else if (strcmp(arg[ia],"-bipro") == 0)  fgbipro = true;
    106136    else if (strcmp(arg[ia],"-dbg") == 0)  dbglev = 1;
    107137    else if (strcmp(arg[ia],"-dbg2") == 0)  dbglev = 2;
     
    133163
    134164    FITSTOIReader r(infile);
    135     cout << "> FITSTOIReader reader created" << endl;
    136     NoOpProcessor noop(wnoop);
    137     NoOpProcessor noop2(wnoop);
    138     cout << "> NoOpProcessor noop noop2 created" << endl;
     165    cout << "> FITSTOIReader reader created File=" << infile << endl;
     166    proc_wsz[0] = wnoop;
     167    NoOpProcessor noop[6];
     168    int k;
     169    for(k=0; k<nb_procs; k++) {
     170      noop[k].SetWSize(proc_wsz[k]);
     171      cout << "> NoOpProcessor noop[" << k << "]  created WSz=" << proc_wsz[k] << endl;
     172    }
    139173   
    140174    cout << "> Connecting to Processors through plombier ... " << endl;
    141175    string inname = "in";
    142     plombier.Connect(r, intoi, noop, inname);
     176    plombier.Connect(r, intoi, noop[0], inname);
    143177   
    144178    if (fgtoi2) {
    145179      int w2 = (wnoop > 0) ? wtoi+wnoop : wtoi;
    146180      inname = "in2";
    147       plombier.Connect(r, intoi2, noop, inname, "", w2);
    148     }
    149     if (fgbipro) {
    150       plombier.Connect(noop, "out", noop2, "in");
    151       if (fgtoi2) plombier.Connect(noop, "out2", noop2, "in2");
     181      plombier.Connect(r, intoi2, noop[0], inname, "", w2);
     182    }
     183    for(k=1; k<nb_procs; k++) {
     184      plombier.Connect(noop[k-1], "out", noop[k], "in");
     185      if (fgtoi2) plombier.Connect(noop[k-1], "out2", noop[k], "in2");
    152186    }
    153187
     
    160194    if (fgprstat) {
    161195      // --------------- Impression continu de stat -------------------
    162       ProcSampleCounter<NoOpProcessor> stats(noop);
     196      ProcSampleCounter<NoOpProcessor> stats(noop[0]);
    163197      stats.InfoMessage() = "mesovh2/Info";
    164198      stats.PrintStats();
     
    170204    PrtTim("End threads");
    171205
    172     cout << noop ;
    173     if (fgbipro) cout << noop2 ;
     206    cout << noop[0] ;
     207    if (nb_procs > 1) cout << noop[nb_procs-1] ;
    174208  }
    175209  catch (PThrowable & exc) {
Note: See TracChangeset for help on using the changeset viewer.