From cfba0a67dcfd01a2b576069753b307300d136c2e Mon Sep 17 00:00:00 2001 From: heister Date: Mon, 17 Sep 2012 20:58:35 +0000 Subject: [PATCH] add timing stuff git-svn-id: https://svn.dealii.org/trunk@26447 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/benchmarks/step-22/step-22.cc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/benchmarks/step-22/step-22.cc b/tests/benchmarks/step-22/step-22.cc index c5a3567d87..44901dce2e 100644 --- a/tests/benchmarks/step-22/step-22.cc +++ b/tests/benchmarks/step-22/step-22.cc @@ -51,6 +51,7 @@ // Then we need to include the header file // for the sparse direct solver UMFPACK: #include +#include // This includes the library for the // incomplete LU factorization that will @@ -167,6 +168,8 @@ namespace Step22 // dangling pointer to an already // destroyed object: std_cxx1x::shared_ptr::type> A_preconditioner; + + TimerOutput timer; }; // @sect3{Boundary values and right hand side} @@ -463,7 +466,8 @@ namespace Step22 triangulation (Triangulation::maximum_smoothing), fe (FE_Q(degree+1), dim, FE_Q(degree), 1), - dof_handler (triangulation) + dof_handler (triangulation), + timer (std::cout, TimerOutput::summary, TimerOutput::cpu_times) {} @@ -1296,20 +1300,34 @@ namespace Step22 std::cout << "Refinement cycle " << refinement_cycle << std::endl; if (refinement_cycle > 0) - refine_mesh (); + { + timer.enter_section("refine"); + refine_mesh (); + timer.exit_section("refine"); + } + timer.enter_section("setup"); setup_dofs (); + timer.exit_section("setup"); std::cout << " Assembling..." << std::endl << std::flush; + timer.enter_section("assembly"); assemble_system (); + timer.exit_section("assembly"); std::cout << " Solving..." << std::flush; + timer.enter_section("solver"); solve (); + timer.exit_section("solver"); + timer.enter_section("results"); output_results (refinement_cycle); + timer.enter_section("results"); std::cout << std::endl; } + + timer.print_summary(); } } -- 2.39.5