-New: The class Timer has the new functions get_total_data(),
-print_total_data, last_wall_time, cpu_time and last_cpu_time()
-for accessing information about the total run and the last lap now.
+New: The Timer class now has new functions Timer::get_total_data(),
+Timer::print_total_data, Timer::last_wall_time, Timer::cpu_time and
+Timer::last_cpu_time() to access information about the total run as
+well as the last lap.
<br>
(Daniel Arndt, 2017/06/23)
start_wall_time (0.),
cumulative_time (0.),
cumulative_wall_time (0.),
- last_lap_time (0.),
- last_lap_cpu_time(0.),
+ last_lap_time (numbers::signaling_nan<double>()),
+ last_lap_cpu_time(numbers::signaling_nan<double>()),
running (false)
#ifdef DEAL_II_WITH_MPI
,
#endif
{
#ifdef DEAL_II_WITH_MPI
- mpi_data.sum = mpi_data.min = mpi_data.max = mpi_data.avg = 0.;
- mpi_data.min_index = mpi_data.max_index = 0;
+ 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;
#endif
start_wall_time (0.),
cumulative_time (0.),
cumulative_wall_time (0.),
- last_lap_time (0.),
- last_lap_cpu_time (0.),
+ last_lap_time (numbers::signaling_nan<double>()),
+ last_lap_cpu_time (numbers::signaling_nan<double>()),
running (false),
mpi_communicator (mpi_communicator),
sync_wall_time(sync_wall_time_)
{
#ifdef DEAL_II_WITH_MPI
- mpi_data.sum = mpi_data.min = mpi_data.max = mpi_data.avg = 0.;
- mpi_data.min_index = mpi_data.max_index = 0;
+ 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;
#endif
void Timer::reset ()
{
- last_lap_time = 0.;
- last_lap_cpu_time = 0.;
+ last_lap_time = numbers::signaling_nan<double>();
+ last_lap_cpu_time = numbers::signaling_nan<double>();
cumulative_time = 0.;
cumulative_wall_time = 0.;
running = false;
#ifdef DEAL_II_WITH_MPI
- mpi_data.sum = mpi_data.min = mpi_data.max = mpi_data.avg = 0.;
- mpi_data.min_index = mpi_data.max_index = 0;
+ 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;
#endif
AssertThrow(old_wall_time > 0., ExcInternalError());
const double old_cpu_time = t.wall_time();
AssertThrow(old_cpu_time > 0., ExcInternalError());
- AssertThrow(t.last_wall_time() == 0., ExcInternalError());
- AssertThrow(t.last_cpu_time() == 0, ExcInternalError());
burn(50);
AssertThrow(t.stop() > 0., ExcInternalError());
t.reset();
AssertThrow(t.wall_time() == 0., ExcInternalError());
AssertThrow(t.cpu_time()== 0., ExcInternalError());
- AssertThrow(t.last_wall_time() == 0., ExcInternalError());
- AssertThrow(t.last_cpu_time() == 0, ExcInternalError());
deallog << "OK" << std::endl;
}
AssertThrow(old_wall_time > 0., ExcInternalError());
const double old_cpu_time = t.wall_time();
AssertThrow(old_cpu_time > 0., ExcInternalError());
- AssertThrow(t.last_wall_time() == 0., ExcInternalError());
- AssertThrow(t.last_cpu_time() == 0., ExcInternalError());
- AssertThrow(t.get_data().min == 0., ExcInternalError());
- AssertThrow(t.get_total_data().min == 0., ExcInternalError());
+ AssertThrow(t.get_total_data().max == 0., ExcInternalError());
burn(50);
AssertThrow(t.stop() > 0., ExcInternalError());
t.reset();
AssertThrow(t.wall_time() == 0., ExcInternalError());
AssertThrow(t.cpu_time()== 0., ExcInternalError());
- AssertThrow(t.last_wall_time() == 0., ExcInternalError());
- AssertThrow(t.last_cpu_time() == 0., ExcInternalError());
- AssertThrow(t.get_data().min == 0., ExcInternalError());
- AssertThrow(t.get_total_data().min == 0, ExcInternalError());
+ AssertThrow(t.get_total_data().max == 0, ExcInternalError());
deallog << "OK" << std::endl;
}