From 2ef6c95ed1376289c0a8452dc6514c06d503b173 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 12 Nov 2016 07:41:16 -0700 Subject: [PATCH] Initialize member variables. --- source/base/timer.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/source/base/timer.cc b/source/base/timer.cc index a9f0f7e401..e6a424badd 100644 --- a/source/base/timer.cc +++ b/source/base/timer.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -49,10 +50,16 @@ Timer::Timer() last_lap_time (0.), running (false) #ifdef DEAL_II_WITH_MPI - , mpi_communicator (MPI_COMM_SELF) - , sync_wall_time (false) + , + mpi_communicator (MPI_COMM_SELF), + sync_wall_time (false) #endif { +#ifdef DEAL_II_WITH_MPI + mpi_data.sum = mpi_data.min = mpi_data.max = mpi_data.avg = numbers::signaling_nan(); + mpi_data.min_index = mpi_data.max_index = numbers::invalid_unsigned_int; +#endif + start(); } @@ -62,7 +69,7 @@ Timer::Timer() // the communicator given from input #ifdef DEAL_II_WITH_MPI Timer::Timer(MPI_Comm mpi_communicator, - bool sync_wall_time_) + const bool sync_wall_time_) : start_time (0.), start_time_children (0.), @@ -74,10 +81,17 @@ Timer::Timer(MPI_Comm mpi_communicator, 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 = numbers::signaling_nan(); + mpi_data.min_index = mpi_data.max_index = numbers::invalid_unsigned_int; +#endif + start(); } #endif + + #ifdef DEAL_II_MSVC namespace -- 2.39.5