Changeset 1699 in Sophya
- Timestamp:
- Oct 15, 2001, 11:55:09 AM (24 years ago)
- Location:
- trunk/ArchTOIPipe
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/toimanager.cc
r1687 r1699 1 1 #include "toimanager.h" 2 #include <unistd.h> 2 3 #include <limits.h> 3 4 #include <pthread.h> 4 5 #include <iostream.h> 5 6 6 #ifndef MAXINT7 #define MAXINT 21474836478 #endif9 10 7 TOIManager::TOIManager() { 11 8 reqBegin = 0; 12 reqEnd = MAXINT;9 reqEnd = LONG_MAX; 13 10 } 14 11 … … 20 17 } 21 18 22 void TOIManager::setRequestedSample( int begin, intend) {19 void TOIManager::setRequestedSample(long begin, long end) { 23 20 reqBegin = begin; 24 21 reqEnd = end; 25 22 } 26 23 27 intTOIManager::getRequestedBegin() {24 long TOIManager::getRequestedBegin() { 28 25 return reqBegin; 29 26 } 30 27 31 intTOIManager::getRequestedEnd() {28 long TOIManager::getRequestedEnd() { 32 29 return reqEnd; 33 30 } … … 96 93 processed_samples = ProcessedSampleCount(); 97 94 if ( (processed_samples-last_sample_count > dns_print) || 98 95 (processed_samples > total_sample_count-10) ) { 99 96 last_sample_count = processed_samples; 100 97 if (nb_dns_print == 0) cout << "\n"; 101 98 nb_dns_print++; 102 99 cout << ">>> " << _msg << ": ProcessedSampleCount()= " << last_sample_count 103 100 << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl; 104 101 if (last_sample_count > total_sample_count-10) alldone = true; 105 102 nb_sleep = 0; … … 107 104 else if ((nb_sleep+1)%5 == 0) 108 105 cout << "> " << _msg << ": ProcSamples()= " << processed_samples 109 110 106 << " Done = " << " %" << processed_samples*100/total_sample_count 107 << " NbSleep(1) = " << nb_sleep << endl; 111 108 112 109 sleep(1); nb_sleep++; -
trunk/ArchTOIPipe/Kernel/toimanager.h
r1687 r1699 12 12 public: 13 13 static TOIManager* getManager(); 14 void setRequestedSample( int begin, intend);15 intgetRequestedBegin();16 intgetRequestedEnd();14 void setRequestedSample(long begin, long end); 15 long getRequestedBegin(); 16 long getRequestedEnd(); 17 17 void addThread(pthread_t*); 18 18 void joinAll(); … … 27 27 }; 28 28 29 29 30 // ----------------------------------------------------------------- 30 31 // Classe pour affichage de l'avancement des TOIProcessors … … 34 35 class RzProcSampleCounter { 35 36 public: 36 RzProcSampleCounter();37 RzProcSampleCounter(); 37 38 virtual ~RzProcSampleCounter(); 38 virtual long 39 virtual long ProcessedSampleCount() = 0; 39 40 virtual long PrintStats(); 40 41 inline int & PrintRate(int pr) { return _rate; } … … 48 49 class ProcSampleCounter : public RzProcSampleCounter { 49 50 public: 50 ProcSampleCounter(const T & t) { _t = &t; }51 virtual long 52 { return _t->ProcessedSampleCount(); }51 ProcSampleCounter(const T & t) { _t = &t; } 52 virtual long ProcessedSampleCount() 53 { return _t->ProcessedSampleCount(); } 53 54 protected: 54 55 const T * _t; … … 56 57 57 58 #endif 58 -
trunk/ArchTOIPipe/Kernel/toisegment.cc
r1697 r1699 28 28 29 29 TOISegmented::TOISegmented(string nm, int bufsz, int maxseg) { 30 master = new MasterView(bufsz, maxseg); 31 setName(nm); 32 } 33 34 TOISegmented::TOISegmented(char* cnm, int bufsz, int maxseg) { 35 string nm = cnm; 30 36 master = new MasterView(bufsz, maxseg); 31 37 setName(nm); -
trunk/ArchTOIPipe/Kernel/toisegment.h
r1692 r1699 20 20 TOISegmented(int bufsz=256, int maxseg=20); 21 21 TOISegmented(string nm, int bufsz=256, int maxseg=20); 22 TOISegmented(char* cnm, int bufsz=256, int maxseg=20); 22 23 ~TOISegmented(); 23 24 -
trunk/ArchTOIPipe/SMakefile
r1668 r1699 13 13 $(AOBJ)toi.o $(AOBJ)toimanager.o $(AOBJ)toiprocessor.o $(AOBJ)genwproc.o \ 14 14 $(AOBJ)toisqfilter.o $(AOBJ)toiregwindow.o $(AOBJ)toiseqbuff.o \ 15 $(AOBJ)toisegment.o \ 15 16 $(AOBJ)simtoipr.o $(AOBJ)map2toi.o $(AOBJ)toi2map.o $(AOBJ)nooppr.o 16 17 EXEOLIST := $(AOBJ)fits2asc.o $(AOBJ)tsttoi.o $(AOBJ)tsttoi2.o $(AOBJ)simtst.o \ … … 24 25 INCLIST := asciitoiwtr.h fitstoirdr.h fitstoiwtr.h toi.h config.h conf.h \ 25 26 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 27 28 28 29 all : $(EXELIST) … … 144 145 $(AOBJ)toi2map.o: toi2map.cc toi2map.h 145 146 $(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 82 82 #include "fitstoiwtr.h" 83 83 #include "toimanager.h" 84 #include "toise qbuff.h"84 #include "toisegment.h" 85 85 #include "sophyainit.h" 86 86 … … 247 247 248 248 // tuyau bolo10 pour entree processeur 249 TOISe qBuffered * bolo10 = new TOISeqBuffered("tuyau_bolo_10",taille);249 TOISegmented * bolo10 = new TOISegmented("tuyau_bolo_10",taille); 250 250 // connection a la colonne correspondante du lecteur fits 251 251 rfits1.addOutput("boloMuV_10",bolo10); … … 257 257 258 258 // tuyau bolo20 pour entree processeur (idem cf au dessus) 259 TOISe qBuffered * bolo20 = new TOISeqBuffered("tuyau_bolo_20",taille);259 TOISegmented * bolo20 = new TOISegmented("tuyau_bolo_20",taille); 260 260 rfits1.addOutput("boloMuV_20",bolo20); 261 261 demo.addInput("entree_bolo_2",bolo20); … … 264 264 265 265 // tuyau bolo30 pour entree processeur (idem cf au dessus) 266 TOISe qBuffered * bolo30 = new TOISeqBuffered("tuyau_bolo_30",taille);266 TOISegmented * bolo30 = new TOISegmented("tuyau_bolo_30",taille); 267 267 rfits2.addOutput("boloMuV_30",bolo30); 268 268 demo.addInput("entree_bolo_3",bolo30); … … 271 271 272 272 // tuyau bolosum pour sortie processeur 273 TOISe qBuffered * bolosum = new TOISeqBuffered("tuyau_bolo_sum",taille);273 TOISegmented * bolosum = new TOISegmented("tuyau_bolo_sum",taille); 274 274 demo.addOutput("sortie_bolo_sum",bolosum); 275 275 writeflag = true; … … 277 277 278 278 // tuyau bolomul pour sortie processeur 279 TOISe qBuffered * bolomul = new TOISeqBuffered("tuyau_bolo_mul",taille);279 TOISegmented * bolomul = new TOISegmented("tuyau_bolo_mul",taille); 280 280 demo.addOutput("sortie_bolo_mul",bolomul); 281 281 writeflag = true; … … 289 289 cout<<"----- FITSWriterTOI::PrintStatus() : -----"<<endl; 290 290 wfits.PrintStatus(cout); 291 cout<<"----- TOISe qBuffered::PrintStatus() : -----"<<endl;291 cout<<"----- TOISegmented::PrintStatus() : -----"<<endl; 292 292 bolo10->PrintStatus(cout); 293 293 bolo20->PrintStatus(cout); … … 306 306 307 307 // 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(); 319 319 320 320 // Gestion de la re-connection des threads … … 346 346 void crefits(void) 347 347 { 348 const int nro = 50000 ;348 const int nro = 500000; 349 349 const int sn1 = 100001; 350 350 const int sn2 = 100001+100;
Note:
See TracChangeset
for help on using the changeset viewer.