From 89ce91264f8c694cbd5d46d1d63f13284f084112 Mon Sep 17 00:00:00 2001 From: heister Date: Fri, 26 Oct 2012 20:01:22 +0000 Subject: [PATCH] avoid printing NaN in TimerOutput. git-svn-id: https://svn.dealii.org/trunk@27218 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/base/timer.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 << "+---------------------------------+-----------+" -- 2.39.5