*/
Timer(MPI_Comm mpi_communicator, const bool sync_lap_times = false);
- /**
- * Return a reference to the data structure with global timing information
- * for the last lap. This structure does not contain meaningful values until
- * Timer::stop() has been called.
- *
- * @deprecated Use Timer::get_last_lap_wall_time_data() instead, which
- * returns a reference to the same structure.
- */
- DEAL_II_DEPRECATED
- const Utilities::MPI::MinMaxAvg &
- get_data() const;
-
/**
* Return a reference to the data structure containing basic statistics on
* the last lap's wall time measured across all MPI processes in the given
const Utilities::MPI::MinMaxAvg &
get_last_lap_wall_time_data() const;
- /**
- * Return a reference to the data structure containing basic statistics on
- * the accumulated wall time measured across all MPI processes in the given
- * communicator. This structure does not contain meaningful values until
- * Timer::stop() has been called.
- *
- * @deprecated Use Timer::get_accumulated_wall_time_data() instead, which
- * returns a reference the same structure.
- */
- DEAL_II_DEPRECATED
- const Utilities::MPI::MinMaxAvg &
- get_total_data() const;
-
/**
* Return a reference to the data structure containing basic statistics on
* the accumulated wall time measured across all MPI processes in the given
const Utilities::MPI::MinMaxAvg &
get_accumulated_wall_time_data() const;
- /**
- * Prints the data returned by get_data(), i.e. for the last lap,
- * to the given stream.
- *
- * @deprecated Use Timer::print_last_lap_wall_time_data() instead, which
- * prints the same information.
- */
- template <class StreamType>
- DEAL_II_DEPRECATED void
- print_data(StreamType &stream) const;
-
/**
* Print the data returned by Timer::get_last_lap_wall_time_data() to the
* given stream.
void
print_last_lap_wall_time_data(StreamType &stream) const;
- /**
- * Prints the data returned by get_total_data(), i.e. for the total run,
- * to the given stream.
- *
- * @deprecated Use Timer::print_accumulated_wall_time_data() instead, which
- * prints the same information.
- */
- template <class StreamType>
- DEAL_II_DEPRECATED void
- print_total_data(StreamType &stream) const;
-
/**
* Print the data returned by Timer::get_accumulated_wall_time_data() to the
* given stream.
void
restart();
- /**
- * Access to the current CPU time without stopping the timer. The elapsed
- * time is returned in units of seconds.
- *
- * @deprecated Use cpu_time() instead.
- */
- DEAL_II_DEPRECATED
- double
- operator()() const;
-
/**
* Return the current accumulated wall time (including the current lap, if
* the timer is running) in seconds without stopping the timer.
double
last_cpu_time() const;
- /**
- * Return the wall time taken between the last start()/stop() call.
- *
- * @deprecated Use last_wall_time() instead.
- */
- DEAL_II_DEPRECATED
- double
- get_lap_time() const;
-
private:
/**
* The Timer class stores timing information for two different clocks: a
-inline const Utilities::MPI::MinMaxAvg &
-Timer::get_data() const
-{
- return last_lap_wall_time_data;
-}
-
-
-
inline const Utilities::MPI::MinMaxAvg &
Timer::get_last_lap_wall_time_data() const
{
-inline const Utilities::MPI::MinMaxAvg &
-Timer::get_total_data() const
-{
- return accumulated_wall_time_data;
-}
-
-
-
inline const Utilities::MPI::MinMaxAvg &
Timer::get_accumulated_wall_time_data() const
{
-template <class StreamType>
-inline void
-Timer::print_data(StreamType &stream) const
-{
- print_last_lap_wall_time_data(stream);
-}
-
-
-
template <class StreamType>
inline void
Timer::print_last_lap_wall_time_data(StreamType &stream) const
-template <class StreamType>
-inline void
-Timer::print_total_data(StreamType &stream) const
-{
- print_accumulated_wall_time_data(stream);
-}
-
-
-
template <class StreamType>
inline void
Timer::print_accumulated_wall_time_data(StreamType &stream) const
-double
-Timer::get_lap_time() const
-{
- return internal::TimerImplementation::to_seconds(wall_times.last_lap_time);
-}
-
-
-
-double
-Timer::operator()() const
-{
- return cpu_time();
-}
-
-
-
double
Timer::wall_time() const
{
if (output_type != wall_times)
{
double total_cpu_time =
- Utilities::MPI::sum(timer_all(), mpi_communicator);
+ Utilities::MPI::sum(timer_all.cpu_time(), mpi_communicator);
// check that the sum of all times is less or equal than the total
// time. otherwise, we might have generated a lot of overhead in this
{
const double total_wall_time = timer_all.wall_time();
double total_cpu_time =
- Utilities::MPI::sum(timer_all(), mpi_communicator);
+ Utilities::MPI::sum(timer_all.cpu_time(), mpi_communicator);
// check that the sum of all times is less or equal than the total time.
// otherwise, we might have generated a lot of overhead in this function.
AssertThrow(old_wall_time > 0., ExcInternalError());
const double old_cpu_time = t.cpu_time();
AssertThrow(old_cpu_time > 0., ExcInternalError());
- assert_min_max_avg_invalid(t.get_data());
- assert_min_max_avg_invalid(t.get_total_data());
assert_min_max_avg_invalid(t.get_last_lap_wall_time_data());
assert_min_max_avg_invalid(t.get_accumulated_wall_time_data());
burn(50);
AssertThrow(t.stop() > 0., ExcInternalError());
- assert_min_max_avg_valid(t.get_data());
- assert_min_max_avg_valid(t.get_total_data());
assert_min_max_avg_valid(t.get_last_lap_wall_time_data());
assert_min_max_avg_valid(t.get_accumulated_wall_time_data());
t.reset();
AssertThrow(t.wall_time() == 0., ExcInternalError());
AssertThrow(t.cpu_time() == 0., ExcInternalError());
- assert_min_max_avg_invalid(t.get_data());
- assert_min_max_avg_invalid(t.get_total_data());
assert_min_max_avg_invalid(t.get_last_lap_wall_time_data());
assert_min_max_avg_invalid(t.get_accumulated_wall_time_data());