16 #ifndef dealii_timer_h 17 #define dealii_timer_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/conditional_ostream.h> 22 #include <deal.II/base/mpi.h> 23 #include <deal.II/base/thread_management.h> 24 #include <deal.II/base/utilities.h> 31 DEAL_II_NAMESPACE_OPEN
50 using rep = duration::rep;
60 using time_point = std::chrono::time_point<CPUClock, duration>;
141 Timer(MPI_Comm mpi_communicator,
const bool sync_lap_times =
false);
162 get_last_lap_wall_time_data()
const;
175 get_total_data()
const;
184 get_accumulated_wall_time_data()
const;
193 template <
class StreamType>
194 DEAL_II_DEPRECATED
void 195 print_data(StreamType &stream)
const;
201 template <
class StreamType>
203 print_last_lap_wall_time_data(StreamType &stream)
const;
212 template <
class StreamType>
213 DEAL_II_DEPRECATED
void 214 print_total_data(StreamType &stream)
const;
220 template <
class StreamType>
222 print_accumulated_wall_time_data(StreamType &stream)
const;
278 last_wall_time()
const;
296 last_cpu_time()
const;
305 get_lap_time()
const;
319 template <
class clock_type_>
691 cpu_and_wall_times_grouped
705 const OutputFrequency output_frequency,
706 const OutputType output_type);
719 const OutputFrequency output_frequency,
720 const OutputType output_type);
746 std::ostream & stream,
747 const OutputFrequency output_frequency,
748 const OutputType output_type);
775 const OutputFrequency output_frequency,
776 const OutputType output_type);
789 enter_subsection(
const std::string §ion_name);
795 enter_section(
const std::string §ion_name);
805 leave_subsection(
const std::string §ion_name =
"");
811 exit_section(
const std::string §ion_name =
"");
816 std::map<std::string, double>
817 get_summary_data(
const OutputData kind)
const;
824 print_summary()
const;
875 double total_cpu_time;
876 double total_wall_time;
877 unsigned int n_calls;
933 return last_lap_wall_time_data;
941 return last_lap_wall_time_data;
949 return accumulated_wall_time_data;
957 return accumulated_wall_time_data;
962 template <
class StreamType>
966 print_last_lap_wall_time_data(stream);
971 template <
class StreamType>
976 stream << statistic.
max <<
" wall," 977 <<
" max @" << statistic.
max_index <<
", min=" << statistic.
min <<
" @" 978 << statistic.
min_index <<
", avg=" << statistic.
avg << std::endl;
983 template <
class StreamType>
987 print_accumulated_wall_time_data(stream);
992 template <
class StreamType>
997 stream << statistic.
max <<
" wall," 998 <<
" max @" << statistic.
max_index <<
", min=" << statistic.
min <<
" @" 999 << statistic.
min_index <<
", avg=" << statistic.
avg << std::endl;
1007 enter_subsection(section_name);
1015 leave_subsection(section_name);
1019 const std::string & section_name_)
1021 , section_name(section_name_)
1036 timer.exit_section(section_name);
1040 DEAL_II_NAMESPACE_CLOSE
typename clock_type::time_point time_point_type
const Utilities::MPI::MinMaxAvg & get_data() const
void print_accumulated_wall_time_data(StreamType &stream) const
MPI_Comm mpi_communicator
MPI_Comm mpi_communicator
static time_point now() noexcept
std::chrono::steady_clock wall_clock_type
void enter_section(const std::string §ion_name)
Utilities::MPI::MinMaxAvg last_lap_wall_time_data
void print_last_lap_wall_time_data(StreamType &stream) const
std::chrono::microseconds duration
const std::string section_name
duration_type accumulated_time
typename clock_type::duration duration_type
ClockMeasurements< wall_clock_type > wall_times
const Utilities::MPI::MinMaxAvg & get_last_lap_wall_time_data() const
duration_type last_lap_time
std::list< std::string > active_sections
static const bool is_steady
void exit_section(const std::string §ion_name="")
void print_total_data(StreamType &stream) const
const Utilities::MPI::MinMaxAvg & get_accumulated_wall_time_data() const
std::map< std::string, Section > sections
ConditionalOStream out_stream
void print_data(StreamType &stream) const
std::chrono::time_point< CPUClock, duration > time_point
OutputFrequency output_frequency
time_point_type current_lap_start_time
Utilities::MPI::MinMaxAvg accumulated_wall_time_data
const Utilities::MPI::MinMaxAvg & get_total_data() const
Scope(::TimerOutput &timer_, const std::string §ion_name)
ClockMeasurements< cpu_clock_type > cpu_times