Changeset 1687 in Sophya for trunk/ArchTOIPipe/Kernel/toimanager.cc
- Timestamp:
- Oct 12, 2001, 1:20:03 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/toimanager.cc
r1684 r1687 47 47 } 48 48 } 49 50 51 // ----------------------------------------------------------------- 52 // Classe pour affichage de l'avancement des TOIProcessors 53 // Reza 08/2001 54 // ----------------------------------------------------------------- 55 56 RzProcSampleCounter::RzProcSampleCounter() 57 { 58 _msg = "SampleCounter/Info"; 59 _rate = 50; 60 } 61 62 RzProcSampleCounter::~RzProcSampleCounter() 63 { 64 } 65 66 long RzProcSampleCounter::PrintStats() 67 { 68 int istart = 0; 69 int iend = 0; 70 long dns_print = 1000; 71 int dns_print_fac = _rate; 72 int nbmax_dns_print = 2; 73 74 TOIManager* mgr = TOIManager::getManager(); 75 76 istart = mgr->getRequestedBegin(); 77 iend = mgr->getRequestedEnd(); 78 79 dns_print = (iend-istart)/dns_print_fac; 80 if (dns_print < 1000) dns_print = ((iend-istart) < 1000) ? (iend-istart) : 1000; 81 if (dns_print < 1) dns_print = 1; 82 nbmax_dns_print = (iend-istart)/dns_print; 83 84 cout << "RzProcSampleCounter::PrintStats() InfoMessage=" << _msg 85 << "\n ... " << _msg << " istart=" 86 << istart << " iend= " << iend << " dns_print= " << dns_print 87 << " nbmax_dns_print= " << nbmax_dns_print << endl; 88 // ------------------- Impression continu de stat ------------------------ 89 long nb_dns_print = 0; 90 int nb_sleep = 0; 91 long last_sample_count = 0; 92 long processed_samples = 0; 93 long total_sample_count = dns_print*nbmax_dns_print; 94 bool alldone = false; 95 while (!alldone) { 96 processed_samples = ProcessedSampleCount(); 97 if ( (processed_samples-last_sample_count > dns_print) || 98 (processed_samples > total_sample_count-10) ) { 99 last_sample_count = processed_samples; 100 if (nb_dns_print == 0) cout << "\n"; 101 nb_dns_print++; 102 cout << ">>> " << _msg << ": ProcessedSampleCount()= " << last_sample_count 103 << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl; 104 if (last_sample_count > total_sample_count-10) alldone = true; 105 nb_sleep = 0; 106 } 107 else if ((nb_sleep+1)%5 == 0) 108 cout << "> " << _msg << ": ProcSamples()= " << processed_samples 109 << " Done = " << " %" << processed_samples*100/total_sample_count 110 << " NbSleep(1) = " << nb_sleep << endl; 111 112 sleep(1); nb_sleep++; 113 } 114 115 // ----------------------------------------------------------------------- 116 117 return last_sample_count; 118 119 }
Note:
See TracChangeset
for help on using the changeset viewer.