]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
fix TimerOutput wall_time in parallel not being synchronized as one expects.
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Apr 2013 18:45:56 +0000 (18:45 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 18 Apr 2013 18:45:56 +0000 (18:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@29333 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/base/timer.h
deal.II/source/base/timer.cc

index 7884f7c326812d8c19c6507ec97b78374dc88837..99f39f441c4c66c71071d5c9cdc99cd3c40163a9 100644 (file)
@@ -64,6 +64,13 @@ this function.
 
 
 <ol>
+  <li> Fixed: TimerOutput constructed with an MPI_COMM in wall_time
+  mode now constructs synchronized Timer objects. This gives reliable
+  parallel benchmark timings.
+  <br>
+  (Timo Heister, 2013/04/18)
+  </li>
+
   <li> New: The step-49 tutorial program now also has a discussion on
   what to do once you have a coarse mesh and want to refine it.
   <br>
index 9450b20a6d9c1cdf658d9247fd2cf75561ed0f29..d9f36d9b7ef413a216849ebacd4bf11490fcba5a 100644 (file)
@@ -409,6 +409,8 @@ public:
    */
   void enter_section (const std::string &section_name);
 
+  //TODO: make some of these functions DEPRECATED (I would keep enter/exit_section)
+
   /**
    * Leave a section. If no name is given,
    * the last section that was entered is
index a1be012b22d94cfd282bf3efd4fbe87b2d03d5ac..2c0b9cf2f9b13270e010362b3be946088f3cf4ca 100644 (file)
@@ -350,6 +350,14 @@ TimerOutput::enter_subsection (const std::string &section_name)
 
   if (sections.find (section_name) == sections.end())
     {
+#ifdef DEAL_II_WITH_MPI
+      if (mpi_communicator != MPI_COMM_SELF)
+        {
+          sections[section_name].timer = Timer(mpi_communicator, true);
+        }
+#endif
+
+
       sections[section_name].total_cpu_time = 0;
       sections[section_name].total_wall_time = 0;
       sections[section_name].n_calls = 0;

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.