00001 00005 00006 #ifndef _LDMACHINEUTIL_H_ 00007 #define _LDMACHINEUTIL_H_ 00008 00009 class LBMachineUtil { 00010 public: 00011 LBMachineUtil(); 00012 void StatsOn(); 00013 void StatsOff(); 00014 void Clear(); 00015 void TotalTime(LBRealType* walltime, LBRealType* cputime); 00016 void IdleTime(LBRealType* walltime) { *walltime = total_idletime; }; 00017 00018 private: 00019 enum : uint8_t { off, on } state; 00020 LBRealType total_walltime; 00021 LBRealType total_idletime; 00022 double start_totalwall; 00023 double start_idle; 00024 #if CMK_LB_CPUTIMER 00025 LBRealType total_cputime; 00026 double start_totalcpu; 00027 #endif 00028 00029 int cancel_idleStart, cancel_idleEnd; 00030 00031 void IdleStart(double curWallTime); 00032 void IdleEnd(double curWallTime); 00033 static void staticIdleStart(LBMachineUtil *util,double curWallTime); 00034 static void staticIdleEnd(LBMachineUtil *util,double curWallTime); 00035 }; 00036 00037 #endif // _LDMACHINEUTIL_H_ 00038