]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Initialize member variables. 3575/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Sat, 12 Nov 2016 14:41:16 +0000 (07:41 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sat, 12 Nov 2016 14:41:16 +0000 (07:41 -0700)
source/base/timer.cc

index a9f0f7e401adb22500f886ee88753fe01d46d1db..e6a424badd966716857dd6dee5f5dd5fe3b20a54 100644 (file)
@@ -17,6 +17,7 @@
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/mpi.h>
 #include <deal.II/base/utilities.h>
+#include <deal.II/base/signaling_nan.h>
 #include <sstream>
 #include <iostream>
 #include <iomanip>
@@ -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<double>();
+  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<double>();
+  mpi_data.min_index = mpi_data.max_index = numbers::invalid_unsigned_int;
+#endif
+
   start();
 }
 #endif
 
+
+
 #ifdef DEAL_II_MSVC
 
 namespace

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.