From: Wolfgang Bangerth Date: Sat, 12 Nov 2016 14:41:16 +0000 (-0700) Subject: Initialize member variables. X-Git-Tag: v8.5.0-rc1~405^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ef6c95ed1376289c0a8452dc6514c06d503b173;p=dealii.git Initialize member variables. --- 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