Changeset 1629 in Sophya for trunk/ArchTOIPipe/Kernel
- Timestamp:
- Aug 8, 2001, 12:01:41 PM (24 years ago)
- Location:
- trunk/ArchTOIPipe/Kernel
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/fitstoirdr.cc
r1527 r1629 11 11 name = "rdr"; 12 12 fptr = NULL; 13 totnscount = 0; 13 14 } 14 15 … … 126 127 cout << "reader reading... NRows=" << nrows << " firstSn= " 127 128 << firstSn << endl; 129 128 130 for (int i=0; i<nrows; i++) { 129 131 int anyNul; … … 149 151 putData(k, sn, y, flg); 150 152 } 153 totnscount++; 151 154 } 152 155 cout << "reader done reading... " << pthread_self() << endl; -
trunk/ArchTOIPipe/Kernel/fitstoirdr.h
r1527 r1629 19 19 20 20 virtual void init(); 21 virtual void run(); 21 virtual void run(); 22 23 inline int_8 ProcessedSampleCount() const { return totnscount; } 22 24 23 25 protected: … … 43 45 // le flag est alors en colonne+1 44 46 47 int_8 totnscount; // Nombre total d'echantillon processe 48 45 49 }; 46 50 -
trunk/ArchTOIPipe/Kernel/fitstoiwtr.cc
r1532 r1629 18 18 fits_unlock(); 19 19 name = "wtr"; 20 21 totnscount = 0; 20 22 } 21 23 … … 148 150 // if ((sn%2000 == 0) || (sn<snb+5)) 149 151 // cout << " DBG-C-FitsWriter::run()" << sn << " line=" << fitsLine << endl; 150 fitsLine++; 152 fitsLine++; totnscount++; 151 153 } catch (PException e) { 152 154 cout << "fitstoiwtr exception " << e.Msg() << endl; -
trunk/ArchTOIPipe/Kernel/fitstoiwtr.h
r1532 r1629 22 22 virtual void addInput(string name, TOI* toi, bool withFlag); 23 23 24 virtual void run(); 24 virtual void run(); 25 26 inline int_8 ProcessedSampleCount() const { return totnscount; } 25 27 26 28 private: … … 32 34 map<int,pair<int, bool> > colsinput; // iTOI -> (colonne, hasflag) 33 35 // le flag est alors en colonne+1 36 37 int_8 totnscount; // Nombre total d'echantillon processe 34 38 }; 35 39 -
trunk/ArchTOIPipe/Kernel/toimanager.cc
r1410 r1629 43 43 } 44 44 } 45 46 47 // ----------------------------------------------------------------- 48 // Classe pour affichage de l'avancement des TOIProcessors 49 // Reza 08/2001 50 // ----------------------------------------------------------------- 51 52 RzProcSampleCounter::RzProcSampleCounter() 53 { 54 _msg = "SampleCounter/Info"; 55 _rate = 50; 56 } 57 58 RzProcSampleCounter::~RzProcSampleCounter() 59 { 60 } 61 62 long RzProcSampleCounter::PrintStats() 63 { 64 int istart = 0; 65 int iend = 0; 66 long dns_print = 1000; 67 int dns_print_fac = _rate; 68 int nbmax_dns_print = 2; 69 70 TOIManager* mgr = TOIManager::getManager(); 71 72 istart = mgr->getRequestedBegin(); 73 iend = mgr->getRequestedEnd(); 74 75 dns_print = (iend-istart)/dns_print_fac; 76 if (dns_print < 1000) dns_print = ((iend-istart) < 1000) ? (iend-istart) : 1000; 77 if (dns_print < 1) dns_print = 1; 78 nbmax_dns_print = (iend-istart)/dns_print; 79 80 cout << "RzProcSampleCounter::PrintStats() InfoMessage=" << _msg 81 << "\n ... " << _msg << " istart=" 82 << istart << " iend= " << iend << " dns_print= " << dns_print 83 << " nbmax_dns_print= " << nbmax_dns_print << endl; 84 // ------------------- Impression continu de stat ------------------------ 85 long nb_dns_print = 0; 86 int nb_sleep = 0; 87 long last_sample_count = 0; 88 long processed_samples = 0; 89 long total_sample_count = dns_print*nbmax_dns_print; 90 bool alldone = false; 91 while (!alldone) { 92 processed_samples = ProcessedSampleCount(); 93 if ( (processed_samples-last_sample_count > dns_print) || 94 (processed_samples > total_sample_count-10) ) { 95 last_sample_count = processed_samples; 96 if (nb_dns_print == 0) cout << "\n"; 97 nb_dns_print++; 98 cout << ">>> " << _msg << ": ProcessedSampleCount()= " << last_sample_count 99 << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl; 100 if (last_sample_count > total_sample_count-10) alldone = true; 101 nb_sleep = 0; 102 } 103 else if ((nb_sleep+1)%5 == 0) 104 cout << "> " << _msg << ": ProcSamples()= " << processed_samples 105 << " Done = " << " %" << processed_samples*100/total_sample_count 106 << " NbSleep(1) = " << nb_sleep << endl; 107 108 sleep(1); nb_sleep++; 109 } 110 111 // ----------------------------------------------------------------------- 112 113 return last_sample_count; 114 115 } -
trunk/ArchTOIPipe/Kernel/toimanager.h
r1410 r1629 26 26 }; 27 27 28 29 // ----------------------------------------------------------------- 30 // Classe pour affichage de l'avancement des TOIProcessors 31 // Reza 08/2001 32 // ----------------------------------------------------------------- 33 34 class RzProcSampleCounter { 35 public: 36 RzProcSampleCounter(); 37 virtual ~RzProcSampleCounter(); 38 virtual long ProcessedSampleCount() = 0; 39 virtual long PrintStats(); 40 inline int & PrintRate(int pr) { return _rate; } 41 inline string& InfoMessage() { return _msg; } 42 protected: 43 int _rate; 44 string _msg; 45 }; 46 47 template <class T> 48 class ProcSampleCounter : public RzProcSampleCounter { 49 public: 50 ProcSampleCounter(const T & t) { _t = &t; } 51 virtual long ProcessedSampleCount() 52 { return _t->ProcessedSampleCount(); } 53 protected: 54 const T * _t; 55 }; 56 28 57 #endif -
trunk/ArchTOIPipe/Kernel/toiprocessor.cc
r1532 r1629 235 235 // cout << p->name << " new thread running " << pthread_self() << endl; 236 236 p->run(); 237 pthread_exit(NULL); 237 238 // cout << p->name << " thread done " << pthread_self() << endl; 238 239 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.