Changeset 1699 in Sophya


Ignore:
Timestamp:
Oct 15, 2001, 11:55:09 AM (24 years ago)
Author:
cmv
Message:

intro des toisegmented + constructeur avec char* pour compat cmv 15/10/01

Location:
trunk/ArchTOIPipe
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/toimanager.cc

    r1687 r1699  
    11#include "toimanager.h"
     2#include <unistd.h>
    23#include <limits.h>
    34#include <pthread.h>
    45#include <iostream.h>
    56
    6 #ifndef MAXINT
    7 #define MAXINT 2147483647
    8 #endif
    9 
    107TOIManager::TOIManager() {
    118  reqBegin = 0;
    12   reqEnd = MAXINT;
     9  reqEnd = LONG_MAX;
    1310}
    1411
     
    2017}
    2118
    22 void TOIManager::setRequestedSample(int begin, int end) {
     19void TOIManager::setRequestedSample(long begin, long end) {
    2320  reqBegin = begin;
    2421  reqEnd   = end;
    2522}
    2623
    27 int TOIManager::getRequestedBegin() {
     24long TOIManager::getRequestedBegin() {
    2825  return reqBegin;
    2926}
    3027
    31 int TOIManager::getRequestedEnd() {
     28long TOIManager::getRequestedEnd() {
    3229  return reqEnd;
    3330}
     
    9693    processed_samples = ProcessedSampleCount();
    9794    if ( (processed_samples-last_sample_count > dns_print) ||
    98         (processed_samples > total_sample_count-10) ) {
     95        (processed_samples > total_sample_count-10) ) {
    9996      last_sample_count = processed_samples;
    10097      if (nb_dns_print == 0) cout << "\n";
    10198      nb_dns_print++;
    10299      cout << ">>> " << _msg << ": ProcessedSampleCount()= " << last_sample_count
    103            << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl;
     100           << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl;
    104101      if (last_sample_count > total_sample_count-10)  alldone = true;
    105102      nb_sleep = 0;
     
    107104    else if ((nb_sleep+1)%5 == 0)
    108105      cout << "> " << _msg << ": ProcSamples()= " <<  processed_samples
    109            << " Done = " << " %" << processed_samples*100/total_sample_count
    110            << " NbSleep(1) = " << nb_sleep << endl;
     106           << " Done = " << " %" << processed_samples*100/total_sample_count
     107           << " NbSleep(1) = " << nb_sleep << endl;
    111108   
    112109    sleep(1);  nb_sleep++;
  • trunk/ArchTOIPipe/Kernel/toimanager.h

    r1687 r1699  
    1212public:
    1313  static TOIManager* getManager();
    14   void setRequestedSample(int begin, int end);
    15   int getRequestedBegin();
    16   int getRequestedEnd();
     14  void setRequestedSample(long begin, long end);
     15  long getRequestedBegin();
     16  long getRequestedEnd();
    1717  void addThread(pthread_t*);
    1818  void joinAll();
     
    2727};
    2828
     29
    2930// -----------------------------------------------------------------
    3031//    Classe pour affichage de l'avancement des TOIProcessors
     
    3435class RzProcSampleCounter {
    3536public:
    36   RzProcSampleCounter();
     37                RzProcSampleCounter();
    3738  virtual       ~RzProcSampleCounter();
    38   virtual long  ProcessedSampleCount() = 0;
     39  virtual long  ProcessedSampleCount() = 0;
    3940  virtual long  PrintStats();
    4041  inline int &  PrintRate(int pr) { return _rate; }
     
    4849class ProcSampleCounter : public RzProcSampleCounter {
    4950public:
    50   ProcSampleCounter(const T & t) { _t = &t; }
    51   virtual long  ProcessedSampleCount()
    52   { return _t->ProcessedSampleCount(); }
     51                ProcSampleCounter(const T & t) { _t = &t; }
     52  virtual long  ProcessedSampleCount()
     53                      { return _t->ProcessedSampleCount(); }
    5354protected:
    5455  const T * _t;
     
    5657
    5758#endif
    58 
  • trunk/ArchTOIPipe/Kernel/toisegment.cc

    r1697 r1699  
    2828
    2929TOISegmented::TOISegmented(string nm, int bufsz, int maxseg) {
     30  master = new MasterView(bufsz, maxseg);
     31  setName(nm);
     32}
     33
     34TOISegmented::TOISegmented(char* cnm, int bufsz, int maxseg) {
     35  string nm = cnm;
    3036  master = new MasterView(bufsz, maxseg);
    3137  setName(nm);
  • trunk/ArchTOIPipe/Kernel/toisegment.h

    r1692 r1699  
    2020  TOISegmented(int bufsz=256, int maxseg=20);
    2121  TOISegmented(string nm, int bufsz=256, int maxseg=20);
     22  TOISegmented(char* cnm, int bufsz=256, int maxseg=20);
    2223  ~TOISegmented();
    2324
  • trunk/ArchTOIPipe/SMakefile

    r1668 r1699  
    1313            $(AOBJ)toi.o $(AOBJ)toimanager.o $(AOBJ)toiprocessor.o $(AOBJ)genwproc.o \
    1414            $(AOBJ)toisqfilter.o $(AOBJ)toiregwindow.o $(AOBJ)toiseqbuff.o \
     15            $(AOBJ)toisegment.o \
    1516            $(AOBJ)simtoipr.o $(AOBJ)map2toi.o $(AOBJ)toi2map.o $(AOBJ)nooppr.o
    1617EXEOLIST := $(AOBJ)fits2asc.o $(AOBJ)tsttoi.o $(AOBJ)tsttoi2.o $(AOBJ)simtst.o \
     
    2425INCLIST := asciitoiwtr.h fitstoirdr.h fitstoiwtr.h toi.h config.h conf.h \
    2526           toiprocessor.h genwproc.h toimanager.h toiseqbuff.h toiregwindow.h \
    26            simtoipr.h map2toi.h toi2map.h nooppr.h
     27           simtoipr.h map2toi.h toi2map.h nooppr.h toisegment.h
    2728
    2829all : $(EXELIST)
     
    144145$(AOBJ)toi2map.o: toi2map.cc toi2map.h
    145146$(AOBJ)nooppr.o: nooppr.cc nooppr.h
     147$(AOBJ)toisegment.o: toisegment.cc toiprocessor.h config.h conf.h toi.h
  • trunk/ArchTOIPipe/TestPipes/tstdemopipe.cc

    r1676 r1699  
    8282#include "fitstoiwtr.h"
    8383#include "toimanager.h"
    84 #include "toiseqbuff.h"
     84#include "toisegment.h"
    8585#include "sophyainit.h"
    8686
     
    247247
    248248 // tuyau bolo10 pour entree processeur
    249  TOISeqBuffered * bolo10 = new TOISeqBuffered("tuyau_bolo_10",taille);
     249 TOISegmented * bolo10 = new TOISegmented("tuyau_bolo_10",taille);
    250250 // connection a la colonne correspondante du lecteur fits
    251251 rfits1.addOutput("boloMuV_10",bolo10);
     
    257257
    258258 // tuyau bolo20 pour entree processeur (idem cf au dessus)
    259  TOISeqBuffered * bolo20 = new TOISeqBuffered("tuyau_bolo_20",taille);
     259 TOISegmented * bolo20 = new TOISegmented("tuyau_bolo_20",taille);
    260260 rfits1.addOutput("boloMuV_20",bolo20);
    261261 demo.addInput("entree_bolo_2",bolo20);
     
    264264
    265265 // tuyau bolo30 pour entree processeur (idem cf au dessus)
    266  TOISeqBuffered * bolo30 = new TOISeqBuffered("tuyau_bolo_30",taille);
     266 TOISegmented * bolo30 = new TOISegmented("tuyau_bolo_30",taille);
    267267 rfits2.addOutput("boloMuV_30",bolo30);
    268268 demo.addInput("entree_bolo_3",bolo30);
     
    271271
    272272 // tuyau bolosum pour sortie processeur
    273  TOISeqBuffered * bolosum = new TOISeqBuffered("tuyau_bolo_sum",taille);
     273 TOISegmented * bolosum = new TOISegmented("tuyau_bolo_sum",taille);
    274274 demo.addOutput("sortie_bolo_sum",bolosum);
    275275 writeflag = true;
     
    277277
    278278 // tuyau bolomul pour sortie processeur
    279  TOISeqBuffered * bolomul = new TOISeqBuffered("tuyau_bolo_mul",taille);
     279 TOISegmented * bolomul = new TOISegmented("tuyau_bolo_mul",taille);
    280280 demo.addOutput("sortie_bolo_mul",bolomul);
    281281 writeflag = true;
     
    289289 cout<<"----- FITSWriterTOI::PrintStatus() : -----"<<endl;
    290290 wfits.PrintStatus(cout); 
    291  cout<<"----- TOISeqBuffered::PrintStatus() : -----"<<endl;
     291 cout<<"----- TOISegmented::PrintStatus() : -----"<<endl;
    292292 bolo10->PrintStatus(cout); 
    293293 bolo20->PrintStatus(cout); 
     
    306306
    307307 //  Affichage de l'avancement des TOIProcessors (optionnel)
    308  ProcSampleCounter<FITSTOIReader> statr(rfits1);
    309  statr.InfoMessage() = "tstdemopipe/Info rfits1";
    310  statr.PrintStats();
    311 
    312  ProcSampleCounter<FITSTOIWriter> statw(wfits);
    313  statw.InfoMessage() = "tstdemopipe/Info wfits";
    314  statw.PrintStats();
    315 
    316  ProcSampleCounter<DemoPipe> statp(demo);
    317  statp.InfoMessage() = "tstdemopipe/Info DemoPipe";
    318  statp.PrintStats();
     308 // ProcSampleCounter<FITSTOIReader> statr(rfits1);
     309 // statr.InfoMessage() = "tstdemopipe/Info rfits1";
     310 // statr.PrintStats();
     311
     312 // ProcSampleCounter<FITSTOIWriter> statw(wfits);
     313 // statw.InfoMessage() = "tstdemopipe/Info wfits";
     314 // statw.PrintStats();
     315
     316 // ProcSampleCounter<DemoPipe> statp(demo);
     317 // statp.InfoMessage() = "tstdemopipe/Info DemoPipe";
     318 // statp.PrintStats();
    319319
    320320 // Gestion de la re-connection des threads
     
    346346void crefits(void)
    347347{
    348  const int nro = 50000;
     348 const int nro = 500000;
    349349 const int sn1 = 100001;
    350350 const int sn2 = 100001+100;
Note: See TracChangeset for help on using the changeset viewer.