]> https://gitweb.dealii.org/ - dealii.git/commitdiff
minor cleanup
authorDenis Davydov <davydden@gmail.com>
Tue, 12 Jun 2018 20:44:50 +0000 (22:44 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 12 Jun 2018 20:44:50 +0000 (22:44 +0200)
doc/news/changes/minor/20180529DenisDavydov_b
source/base/timer.cc

index 8cddb375ecdc3142dc2a3c6b3083ab40f8374961..aed99f61361c123e44ae9a3228f7a629b82a7461 100644 (file)
@@ -1,4 +1,4 @@
 New: TimerOutput::cpu_and_wall_times_grouped will print CPU and
-wallclock time in the a single table.
+wallclock time in a single table.
 <br>
 (Denis Davydov 2018/05/29)
index df1b6505eca0f561d306272e1c141696e0743dc0..2aeb758427f0521c502e45f32f37eee131d8cd70 100644 (file)
@@ -730,6 +730,7 @@ TimerOutput::print_summary() const
         }
     }
   else
+    // output_type == cpu_and_wall_times_grouped
     {
       const double total_wall_time = timer_all.wall_time();
       double       total_cpu_time =
@@ -750,64 +751,27 @@ TimerOutput::print_summary() const
 
       // generate a nice table
       out_stream << "\n\n+---------------------------------------------"
-                 << extra_dash << "+";
-
-      if (output_type != wall_times)
-        out_stream << "------------+------------+";
-
-      if (output_type != cpu_times)
-        out_stream << "------------+------------+";
-
-      out_stream << "\n";
-
-      if (output_type == cpu_times)
-        out_stream << "| Total CPU time elapsed since start          ";
-      else if (output_type == wall_times)
-        out_stream << "| Total wallclock time elapsed since start    ";
-      else
-        out_stream << "| Total CPU/wall time elapsed since start     ";
-
-      out_stream << extra_space << "|";
-
-      if (output_type != wall_times)
-        out_stream << std::setw(10) << std::setprecision(3) << std::right
-                   << total_cpu_time << "s |            |";
-
-      if (output_type != cpu_times)
-        out_stream << std::setw(10) << std::setprecision(3) << std::right
-                   << total_wall_time << "s |            |";
-
-      out_stream << "\n|                                             "
-                 << extra_space << "|";
-
-      if (output_type != wall_times)
-        out_stream << "            |            |";
-
-      if (output_type != cpu_times)
-        out_stream << "            |            |";
-
-      out_stream << "\n| Section                         " << extra_space
-                 << "| no. calls |";
-
-      // FIXME: do we need this?
-      out_stream << std::setw(10) << std::setprecision(3);
-
-      if (output_type != wall_times)
-        out_stream << "  CPU time  | % of total |";
-
-      if (output_type != cpu_times)
-        out_stream << "  wall time | % of total |";
-
-      out_stream << "\n+---------------------------------" << extra_dash
-                 << "+-----------+";
-
-      if (output_type != wall_times)
-        out_stream << "------------+------------+";
-
-      if (output_type != cpu_times)
-        out_stream << "------------+------------+";
-
-      out_stream << std::endl;
+                 << extra_dash << "+"
+                 << "------------+------------+"
+                 << "------------+------------+"
+                 << "\n"
+                 << "| Total CPU/wall time elapsed since start     "
+                 << extra_space << "|" << std::setw(10) << std::setprecision(3)
+                 << std::right << total_cpu_time << "s |            |"
+                 << std::setw(10) << std::setprecision(3) << std::right
+                 << total_wall_time << "s |            |"
+                 << "\n|                                             "
+                 << extra_space << "|"
+                 << "            |            |"
+                 << "            |            |"
+                 << "\n| Section                         " << extra_space
+                 << "| no. calls |" << std::setw(10) << std::setprecision(3)
+                 << "  CPU time  | % of total |"
+                 << "  wall time | % of total |"
+                 << "\n+---------------------------------" << extra_dash
+                 << "+-----------+"
+                 << "------------+------------+"
+                 << "------------+------------+" << std::endl;
 
       for (std::map<std::string, Section>::const_iterator i = sections.begin();
            i != sections.end();
@@ -882,15 +846,10 @@ TimerOutput::print_summary() const
         }
 
       out_stream << "+---------------------------------" << extra_dash
-                 << "+-----------+";
-
-      if (output_type != wall_times)
-        out_stream << "------------+------------+";
-
-      if (output_type != cpu_times)
-        out_stream << "------------+------------+";
-
-      out_stream << std::endl << std::endl;
+                 << "+-----------+"
+                 << "------------+------------+"
+                 << "------------+------------+" << std::endl
+                 << std::endl;
 
       if (output_type != wall_times && time_gap > 0.0)
         out_stream

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.