IPCC  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CTimeMeasurement Class Reference

Time measurement class. More...

#include "TimeMeasurement.h"

Collaboration diagram for CTimeMeasurement:
Collaboration graph

Public Types

enum  MEASUREMENT_INDEX {
  EVALUE = 0, MALLOC, FREE_MEM, COMM,
  FILEIO, MVMUL, VVDOT, EVALUE_MALLOC,
  EVALUE_FREE_MEM, MV_MALLOC, MV_FREE_MEM, MV_COMM,
  VV_COMM
}
 

Public Member Functions

 CTimeMeasurement ()
 
 ~CTimeMeasurement ()
 

Static Public Member Functions

static void MeasurementStart (MEASUREMENT_INDEX index)
 Measurement start for part. More...
 
static void MeasurementEnd (MEASUREMENT_INDEX index)
 Measurement end for part. More...
 
static double GetTakeTime (MEASUREMENT_INDEX index)
 Get taken time for part. More...
 
static void TotalMeasurementStart ()
 Measurement start for total taken time. More...
 
static void TotalMeasurementEnd ()
 Measurement end for total taken time. More...
 
static void InitTimer ()
 Init time related variable. More...
 
static double GetTotalTakeTime ()
 

Static Private Attributes

static double m_fTotalTimeStart = 0.
 Get total taken time. More...
 
static double m_fTotalTimeEnd = 0.
 End time for total. More...
 
static double m_fStartTime [MEASUREMENT_COUNT]
 Start time for part. More...
 
static double m_fTakeTime [MEASUREMENT_COUNT]
 End time for part. More...
 
static bool m_bStarted = false
 

Detailed Description

Time measurement class.

Date
28/Sep/2014

Definition at line 16 of file TimeMeasurement.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

CTimeMeasurement::CTimeMeasurement ( )

Definition at line 16 of file TimeMeasurement.cpp.

17 {
18 }
CTimeMeasurement::~CTimeMeasurement ( )

Definition at line 20 of file TimeMeasurement.cpp.

21 {
22 }

Member Function Documentation

double CTimeMeasurement::GetTakeTime ( MEASUREMENT_INDEX  index)
static

Get taken time for part.

Parameters
indexPart index
Returns
Taken time

Definition at line 64 of file TimeMeasurement.cpp.

References m_fTakeTime.

Referenced by CLanczosMethod::ShowLanczosWorkingTime().

65 {
66 #ifdef DOING_MEASUREMENT
67  return m_fTakeTime[index];
68 #else //DOING_MEASUREMENT
69  return 0;
70 #endif
71 }
static double m_fTakeTime[MEASUREMENT_COUNT]
End time for part.

Here is the caller graph for this function:

static double CTimeMeasurement::GetTotalTakeTime ( )
inlinestatic

Definition at line 30 of file TimeMeasurement.h.

Referenced by CLanczosMethod::ShowLanczosWorkingTime().

30 { return m_fTotalTimeEnd - m_fTotalTimeStart; };
static double m_fTotalTimeEnd
End time for total.
static double m_fTotalTimeStart
Get total taken time.

Here is the caller graph for this function:

void CTimeMeasurement::InitTimer ( )
static

Init time related variable.

Definition at line 24 of file TimeMeasurement.cpp.

References m_fStartTime, m_fTakeTime, and MEASUREMENT_COUNT.

Referenced by TotalMeasurementStart().

25 {
26  int i;
27 
28  for( i = 0; i < MEASUREMENT_COUNT ; i ++ )
29  {
30  m_fStartTime[i] = 0.;
31  m_fTakeTime[i] = 0.;
32  }
33 }
static double m_fTakeTime[MEASUREMENT_COUNT]
End time for part.
static double m_fStartTime[MEASUREMENT_COUNT]
Start time for part.
#define MEASUREMENT_COUNT
Part numbers.

Here is the caller graph for this function:

void CTimeMeasurement::MeasurementEnd ( MEASUREMENT_INDEX  index)
static

Measurement end for part.

Parameters
indexPart index

Definition at line 93 of file TimeMeasurement.cpp.

References m_bStarted, m_fStartTime, and m_fTakeTime.

Referenced by CMPIManager::AllReduceComlex(), CMPIManager::AllReduceDouble(), CLanczosMethod::AppendEigenVector(), CMPIManager::BroadcastBool(), CMPIManager::BroadcastDouble(), CMPIManager::BroadcastInt(), CMPIManager::BroadcastLanczosResult(), CLanczosMethod::BuildTMatrix(), CLanczosMethod::BuildWaveFunction(), CLanczosMethod::DoEigenValueSolving(), CLanczosMethod::DoResidualCheck(), CLanczosMethod::EigenValueSolver(), CLanczosMethod::FinalizeLanczosInterationVariable(), CMPIManager::FinalizeManager(), CLanczosMethod::FinalLanczosVector(), CMPIManager::GatherVDouble(), CMPIManager::GatherVInt(), CMPIManager::GetEigenvalueCountFromDeflationGroup(), CMatrixOperation::Gram_schmidt(), CMPIManager::InitCommunicationBufferMetric(), CLanczosMethod::InitializeTemporaryArrayAndVector(), CLanczosMethod::InitLanczosIterationVariables(), CLanczosMethod::InitLanczosVector(), CLanczosMethod::InitVariables(), CLanczosMethod::IntegrateEigenvaluesEx(), inverse_iter(), CLanczosMethod::LanczosIteration(), CLanczosMethod::LanczosIterationLoop(), CLanczosMethod::MergeDegeneratedEigenvalues(), CMPIManager::MergeVector(), CMPIManager::MergeVectorEx_Optimal(), CMPIManager::MergeVectorOptimal(), CMPIManager::ReceiveDoubleBufferSync(), CLanczosMethod::ReleaseResult(), CLanczosMethod::SaveLanczosResult(), CMPIManager::SendDoubleBufferSync(), CLanczosMethod::SortSolution(), and thomas_alg().

94 {
95  if( false == m_bStarted )
96  return;
97 
98 #ifdef DOING_MEASUREMENT
99 #ifdef DISABLE_MPI_ROUTINE
100  m_fTakeTime[index] += (clock() - m_fStartTime[index])/CLOCKS_PER_SEC;;
101 #else //DISABLE_MPI_ROUTINE
102  m_fTakeTime[index] += (MPI_Wtime() - m_fStartTime[index]);
103 #endif //DISABLE_MPI_ROUTINE
104 #endif
105 }
static double m_fTakeTime[MEASUREMENT_COUNT]
End time for part.
static double m_fStartTime[MEASUREMENT_COUNT]
Start time for part.
static bool m_bStarted

Here is the caller graph for this function:

void CTimeMeasurement::MeasurementStart ( MEASUREMENT_INDEX  index)
static

Measurement start for part.

Parameters
indexPart index

Definition at line 76 of file TimeMeasurement.cpp.

References m_bStarted, and m_fStartTime.

Referenced by CMPIManager::AllReduceComlex(), CMPIManager::AllReduceDouble(), CLanczosMethod::AppendEigenVector(), CMPIManager::BroadcastBool(), CMPIManager::BroadcastDouble(), CMPIManager::BroadcastInt(), CMPIManager::BroadcastLanczosResult(), CLanczosMethod::BuildTMatrix(), CLanczosMethod::BuildWaveFunction(), CLanczosMethod::DoEigenValueSolving(), CLanczosMethod::DoResidualCheck(), CLanczosMethod::EigenValueSolver(), CLanczosMethod::FinalizeLanczosInterationVariable(), CMPIManager::FinalizeManager(), CLanczosMethod::FinalLanczosVector(), CMPIManager::GatherVDouble(), CMPIManager::GatherVInt(), CMPIManager::GetEigenvalueCountFromDeflationGroup(), CMatrixOperation::Gram_schmidt(), CMPIManager::InitCommunicationBufferMetric(), CLanczosMethod::InitializeTemporaryArrayAndVector(), CLanczosMethod::InitLanczosIterationVariables(), CLanczosMethod::InitLanczosVector(), CLanczosMethod::InitVariables(), CLanczosMethod::IntegrateEigenvaluesEx(), inverse_iter(), CLanczosMethod::LanczosIteration(), CLanczosMethod::LanczosIterationLoop(), CLanczosMethod::MergeDegeneratedEigenvalues(), CMPIManager::MergeVector(), CMPIManager::MergeVectorEx_Optimal(), CMPIManager::MergeVectorOptimal(), CMPIManager::ReceiveDoubleBufferSync(), CLanczosMethod::ReleaseResult(), CLanczosMethod::SaveLanczosResult(), CMPIManager::SendDoubleBufferSync(), CLanczosMethod::SortSolution(), and thomas_alg().

77 {
78  if( false == m_bStarted )
79  return;
80 
81 #ifdef DOING_MEASUREMENT
82 #ifdef DISABLE_MPI_ROUTINE
83  m_fStartTime[index] = clock();
84 #else //DISABLE_MPI_ROUTINE
85  m_fStartTime[index] = MPI_Wtime();
86 #endif //DISABLE_MPI_ROUTINE
87 #endif
88 }
static double m_fStartTime[MEASUREMENT_COUNT]
Start time for part.
static bool m_bStarted

Here is the caller graph for this function:

void CTimeMeasurement::TotalMeasurementEnd ( )
static

Measurement end for total taken time.

Definition at line 48 of file TimeMeasurement.cpp.

References m_bStarted, and m_fTotalTimeEnd.

Referenced by CSPLoop::executeSPLoop(), CTBMS_Solver::Launching_TBMS_Solver(), and CLanczosLaunching::LaunchingLanczos().

49 {
50  m_bStarted = false;
51 #ifdef DOING_MEASUREMENT
52 #ifdef DISABLE_MPI_ROUTINE
53  m_fTotalTimeEnd = clock() / CLOCKS_PER_SEC;;
54 #else //DISABLE_MPI_ROUTINE
55  m_fTotalTimeEnd = MPI_Wtime();
56 #endif //DISABLE_MPI_ROUTINE
57 #endif
58 }
static double m_fTotalTimeEnd
End time for total.
static bool m_bStarted

Here is the caller graph for this function:

void CTimeMeasurement::TotalMeasurementStart ( )
static

Measurement start for total taken time.

Definition at line 35 of file TimeMeasurement.cpp.

References InitTimer(), m_bStarted, and m_fTotalTimeStart.

Referenced by CSPLoop::executeSPLoop(), CTBMS_Solver::Launching_TBMS_Solver(), and CLanczosLaunching::LaunchingLanczos().

36 {
37  InitTimer();
38  m_bStarted = true;
39 #ifdef DOING_MEASUREMENT
40 #ifdef DISABLE_MPI_ROUTINE
41  m_fTotalTimeStart = clock() / CLOCKS_PER_SEC;;
42 #else //DISABLE_MPI_ROUTINE
43  m_fTotalTimeStart = MPI_Wtime();
44 #endif //DISABLE_MPI_ROUTINE
45 #endif
46 }
static void InitTimer()
Init time related variable.
static double m_fTotalTimeStart
Get total taken time.
static bool m_bStarted

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

bool CTimeMeasurement::m_bStarted = false
staticprivate
double CTimeMeasurement::m_fStartTime
staticprivate

Start time for part.

Definition at line 35 of file TimeMeasurement.h.

Referenced by InitTimer(), MeasurementEnd(), and MeasurementStart().

double CTimeMeasurement::m_fTakeTime
staticprivate

End time for part.

Definition at line 36 of file TimeMeasurement.h.

Referenced by GetTakeTime(), InitTimer(), and MeasurementEnd().

double CTimeMeasurement::m_fTotalTimeEnd = 0.
staticprivate

End time for total.

Definition at line 34 of file TimeMeasurement.h.

Referenced by TotalMeasurementEnd().

double CTimeMeasurement::m_fTotalTimeStart = 0.
staticprivate

Get total taken time.

Start time for total

Definition at line 30 of file TimeMeasurement.h.

Referenced by TotalMeasurementStart().


The documentation for this class was generated from the following files: