Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

CPUNormalizer Class Reference

author="Igor Markov, 980802" More...

#include <abkcpunorm.h>

Collaboration diagram for CPUNormalizer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CPUNormalizer ()
 ~CPUNormalizer ()
void update ()
double getNormalizingFactor () const
 operator const char * () const

Static Private Attributes

unsigned _numUpdates = 0
double _totTime = 0.0
char _buffer [80]

Detailed Description

author="Igor Markov, 980802"

Definition at line 47 of file abkcpunorm.h.


Constructor & Destructor Documentation

CPUNormalizer::CPUNormalizer  )  [inline]
 

Definition at line 54 of file abkcpunorm.h.

References _numUpdates, and update().

00054 { if (_numUpdates==0) update(); }

Here is the call graph for this function:

CPUNormalizer::~CPUNormalizer  )  [inline]
 

Definition at line 55 of file abkcpunorm.h.

00055 {};


Member Function Documentation

double CPUNormalizer::getNormalizingFactor  )  const
 

Definition at line 60 of file abkcpunorm.cxx.

References _numUpdates, _totTime, and oneUpdateTakesXUltra1sec.

Referenced by operator const char *(), and operator<<().

CPUNormalizer::operator const char *  )  const
 

Definition at line 63 of file abkcpunorm.cxx.

References _buffer, _totTime, and getNormalizingFactor().

00064 { 
00065   if (_totTime<0) strcpy(_buffer," CPU time normalizer failed \n");
00066   else 
00067      sprintf(_buffer,
00068      "# Run-time conversion to Ultra-1 @143.5/71.5MHz, SunProCC4.2/-O5 : %f \n",
00069              getNormalizingFactor());
00070   return _buffer;
00071 }

Here is the call graph for this function:

void CPUNormalizer::update  ) 
 

Definition at line 73 of file abkcpunorm.cxx.

References _numUpdates, _totTime, Timer::getUserTime(), Timer::stop(), and updateSize.

Referenced by CPUNormalizer().

00074 {
00075   Timer tm;
00076   if (_numUpdates>10000) { _numUpdates=0; _totTime=0.0; }
00077 
00078   unsigned *sample1, *sample2, *sample3; // *sample4, *sample5;
00079   sample1=new unsigned[updateSize];
00080   sample2=new unsigned[updateSize];
00081   sample3=new unsigned[updateSize];
00082 //sample4=new unsigned[updateSize];
00083 //sample5=new unsigned[updateSize];
00084   
00085   RandomRawUnsigned ru("CPUNormalizer::update(),ru",999);
00086   for(unsigned k=0; k!=updateSize/3; k++)
00087   {
00088      unsigned addr=ru%updateSize;
00089      sample1[addr]=k / 3;
00090      sample2[addr]=k*k;
00091      sample3[addr]=0;
00092 //   sample4[addr]=0;
00093 //   sample5[addr]=0;
00094   }
00095   delete[] sample1;
00096   delete[] sample2;
00097   delete[] sample3;
00098 //delete[] sample4;
00099 //delete[] sample5;
00100 
00101 /*list<unsigned>   sampleList(sampleVec.size());
00102   copy(sampleVec.begin(),sampleVec.end(),sampleList.begin());
00103 */
00104   tm.stop();
00105   double newTime=tm.getUserTime();
00106   if (newTime>0) _totTime+=newTime;
00107   else _totTime = -1.0;  // failed
00108   _numUpdates++;
00109 //cout << "CPU sampling took : " << tm << endl;
00110 }

Here is the call graph for this function:


Member Data Documentation

char CPUNormalizer::_buffer [static, private]
 

Definition at line 58 of file abkcpunorm.cxx.

Referenced by operator const char *().

unsigned CPUNormalizer::_numUpdates = 0 [static, private]
 

Definition at line 56 of file abkcpunorm.cxx.

Referenced by CPUNormalizer(), getNormalizingFactor(), and update().

double CPUNormalizer::_totTime = 0.0 [static, private]
 

Definition at line 57 of file abkcpunorm.cxx.

Referenced by getNormalizingFactor(), operator const char *(), and update().


The documentation for this class was generated from the following files:
Generated on Mon Apr 25 01:14:12 2005 for Parquete by doxygen 1.3.2