![]() |
Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
#include <CpuTimer.hpp>
Public Member Functions | |
CpuTimer () | |
double | time_since_birth () |
double | time_elapsed () |
Private Member Functions | |
double | runtime () |
Private Attributes | |
double | tAtBirth |
double | tAtLast |
Definition at line 14 of file CpuTimer.hpp.
moab::CpuTimer::CpuTimer | ( | ) | [inline] |
Definition at line 24 of file CpuTimer.hpp.
References runtime(), tAtBirth, and tAtLast.
: mpi_initialized( 0 )
#endif
{
#ifdef MOAB_HAVE_MPI
int flag = 0;
if( MPI_SUCCESS == MPI_Initialized( &flag ) && flag )
{
mpi_initialized = 1;
}
#endif
tAtBirth = runtime();
tAtLast = tAtBirth;
}
double moab::CpuTimer::runtime | ( | ) | [inline, private] |
Definition at line 50 of file CpuTimer.hpp.
Referenced by CpuTimer(), time_elapsed(), and time_since_birth().
{
#ifdef MOAB_HAVE_MPI
if( mpi_initialized )
return MPI_Wtime();
else
return (double)clock() / CLOCKS_PER_SEC;
#else
return (double)clock() / CLOCKS_PER_SEC;
#endif
}
double moab::CpuTimer::time_elapsed | ( | ) | [inline] |
Definition at line 43 of file CpuTimer.hpp.
References runtime(), and tAtLast.
Referenced by moab::AdaptiveKDTree::build_tree(), moab::BVHTree::build_tree(), moab::WriteHDF5Parallel::create_meshset_tables(), moab::NestedRefine::generate_hm(), moab::ReadHDF5::load_file(), moab::ReadHDF5::load_file_partial(), moab::SpatialLocator::locate_points(), moab::WriteHDF5Parallel::parallel_create_file(), moab::WriteHDF5::write_file_impl(), moab::WriteHDF5::write_sets(), and moab::WriteHDF5::write_tag().
{
double tmp = tAtLast;
return ( tAtLast = runtime() ) - tmp;
}
double moab::CpuTimer::time_since_birth | ( | ) | [inline] |
Definition at line 39 of file CpuTimer.hpp.
References runtime(), tAtBirth, and tAtLast.
Referenced by moab::ReadHDF5::load_file(), ToolContext::timer_pop(), ToolContext::timer_push(), moab::DebugOutput::tprint(), and moab::WriteHDF5::write_file_impl().
{
return ( tAtLast = runtime() ) - tAtBirth;
};
double moab::CpuTimer::tAtBirth [private] |
Definition at line 20 of file CpuTimer.hpp.
Referenced by CpuTimer(), and time_since_birth().
double moab::CpuTimer::tAtLast [private] |
Definition at line 20 of file CpuTimer.hpp.
Referenced by CpuTimer(), time_elapsed(), and time_since_birth().