rearranged header inclusion so that now it allows LBDatabase to directly (inline...
[charm.git] / src / ck-ldb / LBMachineUtil.h
1 /*****************************************************************************
2  * $Source$
3  * $Author$
4  * $Date$
5  * $Revision$
6  *****************************************************************************/
7
8 /**
9  * \addtogroup CkLdb
10 */
11 /*@{*/
12
13 #ifndef _LDMACHINEUTIL_H_
14 #define _LDMACHINEUTIL_H_
15
16 class LBMachineUtil {
17 public:
18   LBMachineUtil();
19   void StatsOn();
20   void StatsOff();
21   void Clear();
22   void TotalTime(double* walltime, double* cputime);
23   void IdleTime(double* walltime) { *walltime = total_idletime; };
24
25 private:
26   enum { off, on } state;
27   double total_walltime;
28   double total_cputime;
29   double total_idletime;
30   double start_totalwall;
31   double start_totalcpu;
32   double start_idle;
33
34   int cancel_idleStart, cancel_idleEnd;
35
36   void IdleStart(double curWallTime);
37   void IdleEnd(double curWallTime);
38   static void staticIdleStart(LBMachineUtil *util,double curWallTime);
39   static void staticIdleEnd(LBMachineUtil *util,double curWallTime);
40 };
41
42 #endif  // _LDMACHINEUTIL_H_
43
44 /*@}*/