]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
avoid printing NaN in TimerOutput.
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 26 Oct 2012 20:01:22 +0000 (20:01 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 26 Oct 2012 20:01:22 +0000 (20:01 +0000)
git-svn-id: https://svn.dealii.org/trunk@27218 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/timer.cc

index c7fd69fada7901bdfe2c4b9d0532a64b68080a71..5d6fa4960e9758476f66ecd53dec994f1eafc99e 100644 (file)
@@ -499,7 +499,10 @@ TimerOutput::print_summary () const
           out_stream << i->second.total_cpu_time << "s |";
           out_stream << std::setw(10);
           out_stream << std::setprecision(2);
-          out_stream << i->second.total_cpu_time/total_cpu_time * 100 << "% |";
+          double value = i->second.total_cpu_time/total_cpu_time * 100;
+          if (!numbers::is_finite(value))
+            value = 0.0;
+          out_stream << value << "% |";
         }
       out_stream << std::endl
                  << "+---------------------------------+-----------+"
@@ -566,7 +569,10 @@ TimerOutput::print_summary () const
           out_stream << i->second.total_wall_time << "s |";
           out_stream << std::setw(10);
           out_stream << std::setprecision(2);
-          out_stream << i->second.total_wall_time/total_wall_time * 100 << "% |";
+          double value = i->second.total_wall_time/total_wall_time * 100;
+          if (!numbers::is_finite(value))
+            value = 0.0;
+          out_stream << value << "% |";
         }
       out_stream << std::endl
                  << "+---------------------------------+-----------+"

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.