Analysis Software
Documentation for sPHENIX simulation software
|
#include <coresoftware/blob/master/offline/framework/phool/PHTimer.h>
Classes | |
class | Frequency |
internal frequency read from cpu information file More... | |
struct | time_struct |
used to store high precision time using two integers More... | |
Public Types | |
enum | State { STOP = 0, RUN = 1 } |
enum for timer state More... | |
Public Member Functions | |
State | get_state (void) const |
access timer state | |
PHTimer (const std::string &name="Generic Timer") | |
Construct with a name. | |
void | stop () |
stops the counter | |
void | restart () |
Restart timer. | |
void | print (std::ostream &os=std::cout) const |
Dump elapsed time to provided ostream. | |
void | print_stat (std::ostream &os=std::cout) const |
Dump statistics. | |
void | set_name (const std::string &name) |
Set timer name. | |
std::string | get_name (void) const |
get timer name | |
double | get_accumulated_time (void) const |
get cumulated time | |
unsigned int | get_ncycle (void) const |
get number of cycles | |
double | get_time_per_cycle (void) const |
get averaged time/cycle | |
double | elapsed (void) const |
retrieve elapsed value since last restart (in ms) | |
void | test (double time, std::ostream &os=std::cout) |
test PHTimer for a given amount of time (in ms) | |
Static Public Member Functions | |
static void | PRINT (std::ostream &os=std::cout, const std::string &message="") |
print a message (formated) to a stream | |
Static Private Member Functions | |
static time_struct | get_clock_counts (void) |
gets time from cpu clock counts | |
static double | get_difference (const time_struct &, const time_struct &) |
returns difference between to time | |
Private Attributes | |
std::string | _name |
timer name | |
State | _state |
timer state | |
time_struct | _start_time |
start time structure | |
time_struct | _stop_time |
stop time structure | |
double | _accumulated_time |
cumulated time | |
unsigned int | _ncycle |
number of restart/stop cycles | |
Static Private Attributes | |
static Frequency | _frequency = PHTimer::Frequency() |
static frequency object | |
static const double | _twopower32 = pow(2, 32) |
to stores 2^32 | |
high precision timer
Definition at line 25 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 25 of file PHTimer.h
enum PHTimer::State |
|
inlineexplicit |
Construct with a name.
Definition at line 42 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 42 of file PHTimer.h
References PHTimer::time_struct::_low, and _stop_time.
|
inline |
retrieve elapsed value since last restart (in ms)
Definition at line 126 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 126 of file PHTimer.h
References _start_time, _state, _stop_time, get_clock_counts(), get_difference(), and RUN.
Referenced by print(), PHSimpleKFProp::process_event(), and stop().
|
inline |
get cumulated time
Definition at line 108 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 108 of file PHTimer.h
References _accumulated_time.
Referenced by TrkrNtuplizer::fillOutputNtuples(), SvtxEvaluator::fillOutputNtuples(), MakeSourceLinks::getSourceLinks(), PHActsTrkFitter::getTrackFitResult(), PHActsTrkFitter::loopTracks(), PHRaveVertexing::process_event(), PHActsTrkFitter::process_event(), and PHActsTrkFitter::updateSvtxTrack().
|
inlinestaticprivate |
gets time from cpu clock counts
Definition at line 207 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 207 of file PHTimer.h
References PHTimer::time_struct::_high, PHTimer::time_struct::_low, rdtsc, and t.
Referenced by elapsed(), restart(), and stop().
|
staticprivate |
returns difference between to time
Definition at line 64 of file PHTimer.cc.
View newest version in sPHENIX GitHub at line 64 of file PHTimer.cc
References _frequency, PHTimer::time_struct::_high, PHTimer::time_struct::_low, _twopower32, and PHTimer::Frequency::period().
Referenced by elapsed().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Dump elapsed time to provided ostream.
Definition at line 71 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 71 of file PHTimer.h
References _name, elapsed(), os, and PRINT().
Referenced by test().
|
static |
print a message (formated) to a stream
Definition at line 80 of file PHTimer.cc.
View newest version in sPHENIX GitHub at line 80 of file PHTimer.cc
Referenced by print(), PHTimeServer::print(), print_stat(), PHTimeServer::print_stat(), Fun4AllServer::PrintTimer(), and test().
|
inline |
Dump statistics.
Definition at line 80 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 80 of file PHTimer.h
References _accumulated_time, _name, _ncycle, os, and PRINT().
Referenced by PgPostBankBackupManager::CleanTable(), PgPostBankBackupManager::commitAllBankfromTFile(), and PgPostBankBackupManager::fetchAllBank2TFile().
|
inline |
Restart timer.
Definition at line 64 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 64 of file PHTimer.h
References _start_time, _state, get_clock_counts(), and RUN.
Referenced by PHG4PhenixEventAction::BeginOfEventAction(), PgPostBankBackupManager::CleanTable(), PgPostBankBackupManager::commitAllBankfromTFile(), PgPostBankBackupManager::fetchAllBank2TFile(), TrkrNtuplizer::fillOutputNtuples(), SvtxEvaluator::fillOutputNtuples(), MakeSourceLinks::getSourceLinks(), PHActsTrkFitter::getTrackFitResult(), PHActsTrkFitter::loopTracks(), MvtxApplyHotDead::process_event(), MvtxAlign::process_event(), MvtxPrototype2Align::process_event(), PHSimpleKFProp::process_event(), PHRaveVertexing::process_event(), PHActsTrkFitter::process_event(), test(), and PHActsTrkFitter::updateSvtxTrack().
|
inline |
|
inline |
stops the counter
Definition at line 54 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 54 of file PHTimer.h
References _accumulated_time, _ncycle, _state, _stop_time, elapsed(), get_clock_counts(), and STOP.
Referenced by PgPostBankBackupManager::CleanTable(), PgPostBankBackupManager::commitAllBankfromTFile(), PHG4PhenixEventAction::EndOfEventAction(), PgPostBankBackupManager::fetchAllBank2TFile(), TrkrNtuplizer::fillOutputNtuples(), SvtxEvaluator::fillOutputNtuples(), MakeSourceLinks::getSourceLinks(), PHActsTrkFitter::getTrackFitResult(), SvtxEvaluator::Init(), TrkrNtuplizer::Init(), PHRaveVertexing::InitRun(), PHActsTrkFitter::loopTracks(), MvtxApplyHotDead::process_event(), MvtxAlign::process_event(), MvtxPrototype2Align::process_event(), PHSimpleKFProp::process_event(), PHRaveVertexing::process_event(), PHActsTrkFitter::process_event(), and PHActsTrkFitter::updateSvtxTrack().
|
inline |
|
private |
cumulated time
Definition at line 238 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 238 of file PHTimer.h
Referenced by get_accumulated_time(), get_time_per_cycle(), print_stat(), and stop().
|
staticprivate |
static frequency object
Definition at line 220 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 220 of file PHTimer.h
Referenced by get_difference().
|
private |
timer name
Definition at line 226 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 226 of file PHTimer.h
Referenced by get_name(), print(), print_stat(), set_name(), and test().
|
private |
number of restart/stop cycles
Definition at line 241 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 241 of file PHTimer.h
Referenced by get_ncycle(), get_time_per_cycle(), print_stat(), and stop().
|
private |
|
private |
|
private |
|
staticprivate |
to stores 2^32
Definition at line 223 of file PHTimer.h.
View newest version in sPHENIX GitHub at line 223 of file PHTimer.h
Referenced by get_difference().