|
FEAT 3
Finite Element Analysis Toolbox
|
Time stamp class. More...
#include <time_stamp.hpp>
Public Member Functions | |
| TimeStamp () | |
| Constructor. More... | |
| double | elapsed (const TimeStamp &before) const |
| Calculates the time elapsed between two time stamps. More... | |
| long long | elapsed_micros (const TimeStamp &before) const |
| Calculate the time elapsed between two time stamps in microseconds. More... | |
| long long | elapsed_micros_now () const |
| Calculates the time elapsed between the time stamp and now in microseconds. More... | |
| double | elapsed_now () const |
| Calculates the time elapsed between the time stamp and now. More... | |
| String | elapsed_string (const TimeStamp &before, TimeFormat format=TimeFormat::s_m) const |
| Return the time elapsed between two time stamps as a string. More... | |
| String | elapsed_string_now (TimeFormat format=TimeFormat::s_m) const |
| Calculates the time elapsed between the time stamp and now as a string. More... | |
| bool | operator< (const TimeStamp &other) const |
| Comparison operator. More... | |
| TimeStamp & | stamp () |
| Stamps the current time-stamp. More... | |
Static Public Member Functions | |
| static String | format_micros (long long micros, TimeFormat format=TimeFormat::s_m) |
| Formats an elapsed time in microseconds as a string. More... | |
Private Attributes | |
| clock_t | _clock |
| Our time-stamp. More... | |
Time stamp class.
This class is used to store time stamps and compute elapsed times. The implementation of this class depends on the current platform:
gettimeofday() function.QueryPerformanceCounter() function.clock() function as a fallback implementation.Definition at line 53 of file time_stamp.hpp.
|
inline |
Constructor.
Definition at line 67 of file time_stamp.hpp.
References stamp().
Referenced by elapsed_micros_now(), elapsed_now(), and elapsed_string_now().
|
inline |
Calculates the time elapsed between two time stamps.
| [in] | before | A time stamp that represents a previous moment. |
before and this in seconds. Definition at line 100 of file time_stamp.hpp.
References _clock, and FEAT::Windows::query_performance_frequency().
Referenced by FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >::_apply_smooth_peak(), FEAT::LAFEM::DenseMatrix< DT_, IT_ >::apply(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::apply(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::apply(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::apply(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::apply(), FEAT::Solver::ILUPrecondWithBackend< PreferredBackend::generic, LAFEM::SparseMatrixCSR< DT_, IT_ >, Filter_ >::apply(), FEAT::Solver::ILUPrecondWithBackend< PreferredBackend::generic, LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, dim_ >, Filter_ >::apply(), FEAT::LAFEM::DenseMatrix< DT_, IT_ >::apply_transposed(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::apply_transposed(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::apply_transposed(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::apply_transposed(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::apply_transposed(), FEAT::LAFEM::DenseMatrix< DT_, IT_ >::axpy(), FEAT::LAFEM::DenseVector< DT_, IT_ >::axpy(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::axpy(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::axpy(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::axpy(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::axpy(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::axpy(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::axpy_blocked(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::component_copy(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::component_copy_to(), FEAT::LAFEM::DenseVector< DT_, IT_ >::component_invert(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::component_invert(), FEAT::LAFEM::DenseVector< DT_, IT_ >::component_product(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::component_product(), FEAT::LAFEM::DenseVector< DT_, IT_ >::dot(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::dot(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::dot_blocked(), FEAT::LAFEM::DenseMatrix< DT_, IT_ >::invert(), FEAT::LAFEM::DenseVector< DT_, IT_ >::max_abs_element(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::max_abs_element(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::max_abs_element(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::max_abs_element(), FEAT::LAFEM::SparseVector< DT_, IT_ >::max_abs_element(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::max_abs_element(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::max_abs_element_blocked(), FEAT::LAFEM::DenseVector< DT_, IT_ >::max_element(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::max_element(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::max_element(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::max_element(), FEAT::LAFEM::SparseVector< DT_, IT_ >::max_element(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::max_element(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::max_element_blocked(), FEAT::LAFEM::DenseMatrix< DT_, IT_ >::max_rel_diff(), FEAT::LAFEM::DenseVector< DT_, IT_ >::max_rel_diff(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::max_rel_diff(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::max_rel_diff(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::max_rel_diff(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::max_rel_diff(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::max_rel_diff(), FEAT::LAFEM::SparseVector< DT_, IT_ >::max_rel_diff(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::max_rel_diff(), FEAT::LAFEM::DenseVector< DT_, IT_ >::min_abs_element(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::min_abs_element(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::min_abs_element(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::min_abs_element(), FEAT::LAFEM::SparseVector< DT_, IT_ >::min_abs_element(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::min_abs_element(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::min_abs_element_blocked(), FEAT::LAFEM::DenseVector< DT_, IT_ >::min_element(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::min_element(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::min_element(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::min_element(), FEAT::LAFEM::SparseVector< DT_, IT_ >::min_element(), FEAT::LAFEM::SparseVectorBlocked< DT_, IT_, BlockSize_ >::min_element(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::min_element_blocked(), FEAT::LAFEM::DenseMatrix< DT_, IT_ >::multiply(), FEAT::LAFEM::DenseVector< DT_, IT_ >::norm2(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::norm2(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::norm2_blocked(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::norm2sqr_blocked(), FEAT::LAFEM::DenseMatrix< DT_, IT_ >::norm_frobenius(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::norm_frobenius(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::norm_frobenius(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::norm_frobenius(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::norm_frobenius(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::row_norm2(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::row_norm2(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::row_norm2sqr(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::row_norm2sqr(), FEAT::LAFEM::DenseMatrix< DT_, IT_ >::scale(), FEAT::LAFEM::DenseVector< DT_, IT_ >::scale(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::scale(), FEAT::LAFEM::SparseMatrixBanded< DT_, IT_ >::scale(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::scale(), FEAT::LAFEM::SparseMatrixCSCR< DT_, IT_ >::scale(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::scale(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::scale_blocked(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::scale_cols(), FEAT::LAFEM::SparseMatrixBCSR< DT_, IT_, BlockHeight_, BlockWidth_ >::scale_rows(), FEAT::LAFEM::SparseMatrixCSR< DT_, IT_ >::scale_rows(), FEAT::LAFEM::DenseVector< DT_, IT_ >::triple_dot(), FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::triple_dot(), and FEAT::LAFEM::DenseVectorBlocked< DT_, IT_, BlockSize_ >::triple_dot_blocked().
|
inline |
Calculate the time elapsed between two time stamps in microseconds.
| [in] | before | A time stamp that represents a previous moment. |
before and this in microseconds. Definition at line 135 of file time_stamp.hpp.
References _clock, and FEAT::Windows::query_performance_frequency().
Referenced by FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_colored(), FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_layered(), FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_no_scatter(), FEAT::StopWatch::elapsed_micros(), elapsed_string(), and FEAT::StopWatch::stop().
|
inline |
Calculates the time elapsed between the time stamp and now in microseconds.
Definition at line 157 of file time_stamp.hpp.
References TimeStamp().
Referenced by FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_colored(), FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_layered(), FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_no_scatter(), FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_single(), and FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::operator()().
|
inline |
Calculates the time elapsed between the time stamp and now.
Definition at line 121 of file time_stamp.hpp.
References TimeStamp().
Referenced by FEAT::Geometry::PartiIterative< ConformalMesh< Shape_, num_coords_, Coord_ > >::PartiIterative(), FEAT::Global::SynchScalarTicket< DT_ >::SynchScalarTicket(), FEAT::Global::SynchVectorTicket< VT_, VMT_ >::SynchVectorTicket(), FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >::_apply_coarse(), FEAT::Solver::Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ >::_apply_diag(), FEAT::Solver::Vanka< LAFEM::SaddlePointMatrix< MatrixA_, MatrixB_, MatrixD_ >, Filter_ >::_apply_full(), FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >::_apply_prol(), FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >::_apply_rest(), FEAT::Solver::MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >::_apply_smooth_peak(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::_create(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::create(), FEAT::Control::Domain::PartiDomainControl< DomainLevel_ >::create_rectilinear(), FEAT::Solver::IterationStats::destroy(), FEAT::Global::SynchScalarTicket< DT_ >::wait(), and FEAT::Global::SynchVectorTicket< VT_, VMT_ >::wait().
|
inline |
Return the time elapsed between two time stamps as a string.
See TimeStamp::format_micros() for more information about the formatting options.
| [in] | before | A time stamp that represents a previous moment. |
| [in] | format | Specifies string formatting to be used. |
before and this as a formatted string, for example h:mm:ss.mm. Definition at line 253 of file time_stamp.hpp.
References elapsed_micros(), and format_micros().
|
inline |
Calculates the time elapsed between the time stamp and now as a string.
See TimeStamp::format_micros() for more information about the formatting options.
| [in] | format | Specifies string formatting to be used. |
h:mm:ss.mm. Definition at line 273 of file time_stamp.hpp.
References TimeStamp().
|
inlinestatic |
Formats an elapsed time in microseconds as a string.
This function formats the given elapsed time as a string, where the format depends on the TimeFormat parameter:
h:mm:ss.mmm.h:mm:ss.m:ss.mmm.m:ss.s.mmm.| [in] | micros | The elapsed time to be formatted. |
| [in] | format | Specifies string formatting to be used. |
h:m:ss.mmm. Definition at line 187 of file time_stamp.hpp.
References FEAT::h_m_s, FEAT::h_m_s_m, FEAT::m_s, FEAT::m_s_m, FEAT::s_m, and XABORTM.
Referenced by elapsed_string(), and FEAT::StopWatch::elapsed_string().
|
inline |
Comparison operator.
| [in] | other | Another time-stamp. |
true, if this time-stamp has been taken earlier than other, otherwise false. Definition at line 287 of file time_stamp.hpp.
References _clock.
|
inline |
Stamps the current time-stamp.
This function updates the time-stamp to the current time.
*this Definition at line 79 of file time_stamp.hpp.
References _clock, and FEAT::Windows::query_performance_counter().
Referenced by FEAT::Geometry::PartiIterative< ConformalMesh< Shape_, num_coords_, Coord_ > >::PartiIterative(), TimeStamp(), FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_colored(), FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_layered(), FEAT::Assembly::DomainAssembler< Trafo_ >::Worker< Job_ >::_work_no_scatter(), FEAT::StopWatch::start(), and FEAT::StopWatch::stop().
|
private |
Our time-stamp.
Definition at line 62 of file time_stamp.hpp.
Referenced by elapsed(), elapsed_micros(), operator<(), and stamp().