OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Class implementing single timer, providing wall clock and user time capabilities. More...
#include <timer.h>
Public Member Functions | |
Timer () | |
void | startTimer () |
void | stopTimer () |
void | pauseTimer () |
void | resumeTimer () |
void | initTimer () |
bool | isRunning () |
double | getUtime () |
Returns total user time elapsed in seconds. More... | |
double | getWtime () |
Returns total elapsed wall clock time in seconds. More... | |
void | toString (char *buff) |
Prints receiver state into a string. More... | |
void | updateElapsedTime () |
Static Public Member Functions | |
static void | convert2HMS (int &nhrs, int &nmin, int &nsec, double tsec) |
Converts total seconds into hours, minutes and remaining seconds. More... | |
Private Member Functions | |
void | getUtime (std::chrono::duration< double > &answer) |
Platform independent wrapper for user time. More... | |
void | getTime (std::chrono::time_point< std::chrono::high_resolution_clock > &answer) |
Platform independent wrapper for wall time. More... | |
Private Attributes | |
std::chrono::time_point< std::chrono::high_resolution_clock > | start_wtime |
Wall clock time markers. More... | |
std::chrono::time_point< std::chrono::high_resolution_clock > | end_wtime |
std::chrono::duration< double > | start_utime |
User time. More... | |
std::chrono::duration< double > | end_utime |
std::chrono::duration< double > | elapsedWTime |
Accumulated wtime and utime (in seconds) from start. More... | |
std::chrono::duration< double > | elapsedUTime |
bool | running |
Flag indicating whether timer is running. More... | |
Class implementing single timer, providing wall clock and user time capabilities.
oofem::Timer::Timer | ( | ) |
Definition at line 64 of file timer.C.
References initTimer().
|
static |
Converts total seconds into hours, minutes and remaining seconds.
[out] | nhrs | Number of hours. |
[out] | nmin | Number of minutes. |
[out] | nsec | Number of seconds. |
[in] | tsec | Total time in seconds. |
Definition at line 117 of file timer.C.
Referenced by oofem::EngngModelTimer::convert2HMS().
|
private |
Platform independent wrapper for wall time.
Definition at line 59 of file timer.C.
Referenced by pauseTimer(), resumeTimer(), and startTimer().
double oofem::Timer::getUtime | ( | ) |
Returns total user time elapsed in seconds.
Definition at line 105 of file timer.C.
References elapsedUTime, and updateElapsedTime().
Referenced by oofem::AdaptiveNonLinearStatic::adaptiveRemap(), oofem::NonLinearDynamic::assemble(), oofem::NonLinearStatic::assemble(), oofem::DynCompRow::buildInternalStructure(), oofem::OctreeSpatialLocalizer::buildOctreeDataStructure(), oofem::TransportGradientDirichlet::computeTangent(), oofem::PrescribedGradientBCWeak::computeTangent(), oofem::Subdivision::createMesh(), oofem::SkylineUnsym::factorized(), oofem::Skyline::factorized(), oofem::EngngModel::forceEquationNumbering(), oofem::DelaunayTriangulator::giveTimeReport(), oofem::DynCompRow::ILUPYourself(), oofem::CompCol_ILUPreconditioner::init(), oofem::AdaptiveNonLinearStatic::initializeAdaptiveFrom(), pauseTimer(), oofem::PetscSolver::petsc_solve(), resumeTimer(), oofem::MKLPardisoSolver::solve(), oofem::SLEPcSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), oofem::SuperLUSolver::solve(), oofem::SpoolesSolver::solve(), oofem::IMLSolver::solve(), oofem::HuertaErrorEstimator::solveRefinedElementProblem(), oofem::HuertaErrorEstimator::solveRefinedPatchProblem(), oofem::HuertaErrorEstimator::solveRefinedWholeProblem(), oofem::SUPG::solveYourselfAt(), oofem::CBS::solveYourselfAt(), startTimer(), toString(), oofem::NonLinearDynamic::updateComponent(), and oofem::ParticleTopologyDescription::updateYourself().
|
private |
double oofem::Timer::getWtime | ( | ) |
Returns total elapsed wall clock time in seconds.
Definition at line 111 of file timer.C.
References elapsedWTime, and updateElapsedTime().
Referenced by oofem::SuperLUSolver::solve(), and toString().
void oofem::Timer::initTimer | ( | ) |
Definition at line 98 of file timer.C.
References elapsedUTime, elapsedWTime, and running.
Referenced by oofem::EngngModelTimer::initTimer(), startTimer(), and Timer().
void oofem::Timer::pauseTimer | ( | ) |
Definition at line 83 of file timer.C.
References end_utime, end_wtime, getTime(), getUtime(), running, and updateElapsedTime().
Referenced by oofem::DelaunayTriangulator::findNonDelaunayTriangles(), oofem::DelaunayTriangulator::initializeTimers(), oofem::DelaunayTriangulator::meshPolygon(), oofem::EngngModelTimer::pauseTimer(), stopTimer(), and updateElapsedTime().
void oofem::Timer::resumeTimer | ( | ) |
Definition at line 91 of file timer.C.
References getTime(), getUtime(), running, start_utime, and start_wtime.
Referenced by oofem::DelaunayTriangulator::findNonDelaunayTriangles(), oofem::DelaunayTriangulator::meshPolygon(), oofem::EngngModelTimer::resumeTimer(), and updateElapsedTime().
void oofem::Timer::startTimer | ( | ) |
Definition at line 69 of file timer.C.
References getTime(), getUtime(), initTimer(), running, start_utime, and start_wtime.
Referenced by oofem::AdaptiveNonLinearStatic::adaptiveRemap(), oofem::NonLinearDynamic::assemble(), oofem::NonLinearStatic::assemble(), oofem::DynCompRow::buildInternalStructure(), oofem::OctreeSpatialLocalizer::buildOctreeDataStructure(), oofem::TransportGradientDirichlet::computeTangent(), oofem::PrescribedGradientBCWeak::computeTangent(), oofem::Subdivision::createMesh(), oofem::SkylineUnsym::factorized(), oofem::Skyline::factorized(), oofem::EngngModel::forceEquationNumbering(), oofem::DynCompRow::ILUPYourself(), oofem::CompCol_ILUPreconditioner::init(), oofem::AdaptiveNonLinearStatic::initializeAdaptiveFrom(), oofem::DelaunayTriangulator::initializeTimers(), oofem::PetscSolver::petsc_solve(), oofem::MKLPardisoSolver::solve(), oofem::SLEPcSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), oofem::SuperLUSolver::solve(), oofem::SpoolesSolver::solve(), oofem::IMLSolver::solve(), oofem::HuertaErrorEstimator::solveRefinedElementProblem(), oofem::HuertaErrorEstimator::solveRefinedPatchProblem(), oofem::HuertaErrorEstimator::solveRefinedWholeProblem(), oofem::SUPG::solveYourselfAt(), oofem::CBS::solveYourselfAt(), oofem::EngngModelTimer::startTimer(), oofem::NonLinearDynamic::updateComponent(), and oofem::ParticleTopologyDescription::updateYourself().
void oofem::Timer::stopTimer | ( | ) |
Definition at line 77 of file timer.C.
References pauseTimer(), and running.
Referenced by oofem::AdaptiveNonLinearStatic::adaptiveRemap(), oofem::NonLinearDynamic::assemble(), oofem::NonLinearStatic::assemble(), oofem::DynCompRow::buildInternalStructure(), oofem::OctreeSpatialLocalizer::buildOctreeDataStructure(), oofem::TransportGradientDirichlet::computeTangent(), oofem::PrescribedGradientBCWeak::computeTangent(), oofem::Subdivision::createMesh(), oofem::SkylineUnsym::factorized(), oofem::Skyline::factorized(), oofem::EngngModel::forceEquationNumbering(), oofem::DelaunayTriangulator::giveTimeReport(), oofem::DynCompRow::ILUPYourself(), oofem::CompCol_ILUPreconditioner::init(), oofem::AdaptiveNonLinearStatic::initializeAdaptiveFrom(), oofem::PetscSolver::petsc_solve(), oofem::MKLPardisoSolver::solve(), oofem::SLEPcSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), oofem::SuperLUSolver::solve(), oofem::SpoolesSolver::solve(), oofem::IMLSolver::solve(), oofem::HuertaErrorEstimator::solveRefinedElementProblem(), oofem::HuertaErrorEstimator::solveRefinedPatchProblem(), oofem::HuertaErrorEstimator::solveRefinedWholeProblem(), oofem::SUPG::solveYourselfAt(), oofem::CBS::solveYourselfAt(), oofem::EngngModelTimer::stopTimer(), oofem::NonLinearDynamic::updateComponent(), and oofem::ParticleTopologyDescription::updateYourself().
void oofem::Timer::toString | ( | char * | buff | ) |
Prints receiver state into a string.
Definition at line 135 of file timer.C.
References getUtime(), and getWtime().
void oofem::Timer::updateElapsedTime | ( | ) |
Definition at line 140 of file timer.C.
References elapsedUTime, elapsedWTime, end_utime, end_wtime, pauseTimer(), resumeTimer(), running, start_utime, and start_wtime.
Referenced by getUtime(), getWtime(), and pauseTimer().
|
private |
Definition at line 53 of file timer.h.
Referenced by getUtime(), initTimer(), and updateElapsedTime().
|
private |
Accumulated wtime and utime (in seconds) from start.
Definition at line 53 of file timer.h.
Referenced by getWtime(), initTimer(), and updateElapsedTime().
|
private |
Definition at line 51 of file timer.h.
Referenced by pauseTimer(), and updateElapsedTime().
|
private |
Definition at line 49 of file timer.h.
Referenced by pauseTimer(), and updateElapsedTime().
|
private |
Flag indicating whether timer is running.
Definition at line 55 of file timer.h.
Referenced by initTimer(), pauseTimer(), resumeTimer(), startTimer(), stopTimer(), and updateElapsedTime().
|
private |
User time.
Definition at line 51 of file timer.h.
Referenced by resumeTimer(), startTimer(), and updateElapsedTime().
|
private |
Wall clock time markers.
Definition at line 49 of file timer.h.
Referenced by resumeTimer(), startTimer(), and updateElapsedTime().