From: Timo Heister Date: Fri, 26 Oct 2012 20:01:22 +0000 (+0000) Subject: avoid printing NaN in TimerOutput. X-Git-Tag: v8.0.0~1921 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd7f1f479e8e8dcfaa438a7cd5ea769fa28ea928;p=dealii.git avoid printing NaN in TimerOutput. git-svn-id: https://svn.dealii.org/trunk@27218 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/base/timer.cc b/deal.II/source/base/timer.cc index c7fd69fada..5d6fa4960e 100644 --- a/deal.II/source/base/timer.cc +++ b/deal.II/source/base/timer.cc @@ -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 << "+---------------------------------+-----------+"