3d24f780e0d334837273ed19de374a49994dd3bc
[charm.git] / src / ck-ldb / LBMachineUtil.h
1 /**
2  * \addtogroup CkLdb
3 */
4 /*@{*/
5
6 #ifndef _LDMACHINEUTIL_H_
7 #define _LDMACHINEUTIL_H_
8
9 class LBMachineUtil {
10 public:
11   LBMachineUtil();
12   void StatsOn();
13   void StatsOff();
14   void Clear();
15   void TotalTime(LBRealType* walltime, LBRealType* cputime);
16   void IdleTime(LBRealType* walltime) { *walltime = total_idletime; };
17
18 private:
19   enum { off, on } state;
20   LBRealType total_walltime;
21   LBRealType total_idletime;
22   double start_totalwall;
23   double start_idle;
24 #if CMK_LB_CPUTIMER
25   LBRealType total_cputime;
26   double start_totalcpu;
27 #endif
28
29   int cancel_idleStart, cancel_idleEnd;
30
31   void IdleStart(double curWallTime);
32   void IdleEnd(double curWallTime);
33   static void staticIdleStart(LBMachineUtil *util,double curWallTime);
34   static void staticIdleEnd(LBMachineUtil *util,double curWallTime);
35 };
36
37 #endif  // _LDMACHINEUTIL_H_
38
39 /*@}*/