/**
* Return a reference to the data structure with global timing information
* for the last lap. Filled after calling stop().
+ *
+ * @deprecated Use Timer::get_last_lap_data() instead, which returns a
+ * reference to the same structure.
+ */
+ const Utilities::MPI::MinMaxAvg &get_data() const DEAL_II_DEPRECATED;
+
+ /**
+ * Return a reference to the data structure containing timing information
+ * across all MPI processes in the given communicator about the last
+ * lap. Filled after calling stop().
*/
- const Utilities::MPI::MinMaxAvg &get_data() const;
+ const Utilities::MPI::MinMaxAvg &get_last_lap_data() const;
/**
* Return a reference to the data structure with global timing information
- * for the total run.
- * Filled after calling stop().
+ * for the total run. Filled after calling stop().
+ *
+ * @deprecated Use Timer::get_accumulated_wall_time_data() instead, which
+ * returns a reference the same structure.
*/
- const Utilities::MPI::MinMaxAvg &get_total_data() const;
+ const Utilities::MPI::MinMaxAvg &get_total_data() const DEAL_II_DEPRECATED;
+
+ /**
+ * Return a reference to the data structure with global timing information
+ * for the total run. Filled after calling stop().
+ */
+ 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_data() instead, which prints the
+ * same information.
+ */
+ template <class StreamType>
+ void print_data(StreamType &stream) const DEAL_II_DEPRECATED;
+
+ /**
+ * Print the data returned by Timer::get_last_lap_data() to the given
+ * stream.
*/
template <class StreamType>
- void print_data(StreamType &stream) const;
+ void print_last_lap_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>
- void print_total_data(StreamType &stream) const;
+ void print_total_data(StreamType &stream) const DEAL_II_DEPRECATED;
+ /**
+ * Print the data returned by Timer::get_accumulated_wall_time_data() to the
+ * given stream.
+ */
+ template <class StreamType>
+ void print_accumulated_wall_time_data(StreamType &stream) const;
/**
* Re-start the timer at the point where it was stopped. This way a
bool sync_wall_time;
/**
- * A structure for parallel wall time measurement that includes the minimum
- * time recorded among all processes, the maximum time as well as the
- * average time defined as the sum of all individual times divided by the
- * number of MPI processes in the MPI_Comm for the last lap.
+ * A structure for parallel wall time measurement that includes the minimum,
+ * maximum, and average over all processors known to the MPI communicator of
+ * the last lap time.
*/
- Utilities::MPI::MinMaxAvg mpi_data;
+ Utilities::MPI::MinMaxAvg last_lap_data;
/**
* A structure for parallel wall time measurement that includes the minimum
* average time defined as the sum of all individual times divided by the
* number of MPI processes in the MPI_Comm for the total run time.
*/
- Utilities::MPI::MinMaxAvg mpi_total_data;
+ Utilities::MPI::MinMaxAvg accumulated_wall_time_data;
};
const Utilities::MPI::MinMaxAvg &
Timer::get_data() const
{
- return mpi_data;
+ return last_lap_data;
+}
+
+
+
+inline
+const Utilities::MPI::MinMaxAvg &
+Timer::get_last_lap_data() const
+{
+ return last_lap_data;
}
const Utilities::MPI::MinMaxAvg &
Timer::get_total_data() const
{
- return mpi_total_data;
+ return accumulated_wall_time_data;
+}
+
+
+
+inline
+const Utilities::MPI::MinMaxAvg &
+Timer::get_accumulated_wall_time_data() const
+{
+ return accumulated_wall_time_data;
}
void
Timer::print_data(StreamType &stream) const
{
- const Utilities::MPI::MinMaxAvg statistic = get_data();
+ print_last_lap_data(stream);
+}
+
+
+
+template <class StreamType>
+inline
+void
+Timer::print_last_lap_data(StreamType &stream) const
+{
+ const Utilities::MPI::MinMaxAvg statistic = get_last_lap_data();
stream << statistic.max << " wall,"
<< " max @" << statistic.max_index << ", min=" << statistic.min << " @"
<< statistic.min_index << ", avg=" << statistic.avg << std::endl;
void
Timer::print_total_data(StreamType &stream) const
{
- const Utilities::MPI::MinMaxAvg statistic = get_total_data();
+ print_accumulated_wall_time_data(stream);
+}
+
+
+
+template <class StreamType>
+inline
+void
+Timer::print_accumulated_wall_time_data(StreamType &stream) const
+{
+ const Utilities::MPI::MinMaxAvg statistic = get_accumulated_wall_time_data();
stream << statistic.max << " wall,"
<< " max @" << statistic.max_index << ", min=" << statistic.min << " @"
<< statistic.min_index << ", avg=" << statistic.avg << std::endl;
mpi_communicator (mpi_communicator),
sync_wall_time(sync_wall_time_)
{
- mpi_data.sum = mpi_data.min = mpi_data.max = mpi_data.avg = numbers::signaling_nan<double>();
- mpi_data.min_index = mpi_data.max_index = numbers::invalid_unsigned_int;
- mpi_total_data.sum = mpi_total_data.min = mpi_total_data.max = mpi_total_data.avg = 0.;
- mpi_total_data.min_index = mpi_total_data.max_index = 0;
+ last_lap_data.sum = last_lap_data.min = last_lap_data.max = last_lap_data.avg = numbers::signaling_nan<double>();
+ last_lap_data.min_index = last_lap_data.max_index = numbers::invalid_unsigned_int;
+ accumulated_wall_time_data.sum = accumulated_wall_time_data.min = accumulated_wall_time_data.max = accumulated_wall_time_data.avg = 0.;
+ accumulated_wall_time_data.min_index = accumulated_wall_time_data.max_index = 0;
start();
}
# error "Unsupported platform. Porting not finished."
#endif
- this->mpi_data = Utilities::MPI::min_max_avg (last_lap_time,
- mpi_communicator);
- if (sync_wall_time && Utilities::MPI::job_supports_mpi())
+ last_lap_data = Utilities::MPI::min_max_avg (last_lap_time,
+ mpi_communicator);
+ if (sync_wall_time)
{
- last_lap_time = this->mpi_data.max;
+ last_lap_time = last_lap_data.max;
last_lap_cpu_time = Utilities::MPI::min_max_avg (last_lap_cpu_time,
mpi_communicator).max;
}
accumulated_wall_time += last_lap_time;
accumulated_cpu_time += last_lap_cpu_time;
- this->mpi_total_data = Utilities::MPI::min_max_avg (accumulated_wall_time,
- mpi_communicator);
+ accumulated_wall_time_data = Utilities::MPI::min_max_avg (accumulated_wall_time,
+ mpi_communicator);
}
return accumulated_cpu_time;
}
accumulated_cpu_time = 0.;
accumulated_wall_time = 0.;
running = false;
- mpi_data.sum = mpi_data.min = mpi_data.max = mpi_data.avg = numbers::signaling_nan<double>();
- mpi_data.min_index = mpi_data.max_index = numbers::invalid_unsigned_int;
- mpi_total_data.sum = mpi_total_data.min = mpi_total_data.max = mpi_total_data.avg = 0.;
- mpi_total_data.min_index = mpi_total_data.max_index = 0;
+ last_lap_data.sum = last_lap_data.min = last_lap_data.max = last_lap_data.avg = numbers::signaling_nan<double>();
+ last_lap_data.min_index = last_lap_data.max_index = numbers::invalid_unsigned_int;
+ accumulated_wall_time_data.sum = accumulated_wall_time_data.min = accumulated_wall_time_data.max = accumulated_wall_time_data.avg = 0.;
+ accumulated_wall_time_data.min_index = accumulated_wall_time_data.max_index = 0;
}