]> https://gitweb.dealii.org/ - dealii.git/commitdiff
step-42: update timing stuff
authorTimo Heister <timo.heister@gmail.com>
Wed, 20 Mar 2013 15:13:13 +0000 (15:13 +0000)
committerTimo Heister <timo.heister@gmail.com>
Wed, 20 Mar 2013 15:13:13 +0000 (15:13 +0000)
git-svn-id: https://svn.dealii.org/trunk@28954 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-42/step-42.cc

index 25f86d3827b797153602652c7a75823feb63ce13..1a77c4e03bc16f2737b72131bb240be73f710803 100644 (file)
@@ -605,7 +605,8 @@ namespace Step42
     gamma (0.01),
     e_modul (2.0e+5),
     nu (0.3),
-    computing_timer (pcout,
+    computing_timer (MPI_COMM_WORLD,
+                     pcout,
                      TimerOutput::summary,
                      TimerOutput::wall_times)
   {
@@ -661,12 +662,14 @@ namespace Step42
   {
     // setup dofs
     {
+      computing_timer.enter_section("Setup: distribute DoFs");
       dof_handler.distribute_dofs (fe);
 
       locally_owned_dofs = dof_handler.locally_owned_dofs ();
       locally_relevant_dofs.clear();
       DoFTools::extract_locally_relevant_dofs (dof_handler,
                                                locally_relevant_dofs);
+      computing_timer.exit_section("Setup: distribute DoFs");
     }
 
     // setup hanging nodes and dirichlet constraints
@@ -703,6 +706,7 @@ namespace Step42
 
     // setup sparsity pattern
     {
+      computing_timer.enter_section("Setup: matrix");
       TrilinosWrappers::SparsityPattern sp (locally_owned_dofs,
                                             mpi_communicator);
 
@@ -724,6 +728,7 @@ namespace Step42
       number_iterations = 0;
 
       diag_mass_matrix_vector.compress (VectorOperation::insert);
+      computing_timer.exit_section("Setup: matrix");
     }
   }
 
@@ -1190,7 +1195,7 @@ namespace Step42
   template <int dim>
   void PlasticityContactProblem<dim>::solve ()
   {
-    computing_timer.enter_section ("Solving and Preconditioning");
+    computing_timer.enter_section ("Solve");
 
     TrilinosWrappers::MPI::Vector    distributed_solution (system_rhs_newton);
     distributed_solution = solution;
@@ -1200,13 +1205,13 @@ namespace Step42
     distributed_solution.compress(VectorOperation::insert);
     system_rhs_newton.compress(VectorOperation::insert);
 
-    computing_timer.enter_section("Preconditioning");
+    computing_timer.enter_section("Solve: setup preconditioner");
 
     preconditioner_u.initialize (system_matrix_newton, additional_data);
 
-    computing_timer.exit_section("Preconditioning");
+    computing_timer.exit_section("Solve: setup preconditioner");
 
-    computing_timer.enter_section("Solving");
+    computing_timer.enter_section("Solve: iterate");
 
     PrimitiveVectorMemory<TrilinosWrappers::MPI::Vector> mem;
     TrilinosWrappers::MPI::Vector    tmp (system_rhs_newton);
@@ -1226,7 +1231,7 @@ namespace Step42
           << " FGMRES iterations."
           << std::endl;
 
-    computing_timer.exit_section("Solving");
+    computing_timer.exit_section("Solve: iterate");
 
     number_iterations += solver_control.last_step();
 
@@ -1234,7 +1239,7 @@ namespace Step42
 
     solution = distributed_solution;
 
-    computing_timer.exit_section("Solving and Preconditioning");
+    computing_timer.exit_section("Solve");
   }
 
 
@@ -1486,7 +1491,7 @@ namespace Step42
     const unsigned int n_cycles = 6;
     for (cycle=0; cycle<n_cycles; ++cycle)
       {
-        computing_timer.enter_section("Mesh refinement and setup system");
+        computing_timer.enter_section("Setup");
 
         pcout << "" <<std::endl;
         pcout << "Cycle " << cycle << ':' << std::endl;
@@ -1497,8 +1502,10 @@ namespace Step42
           }
         else
           {
+                computing_timer.enter_section("Setup: refine mesh");
                soltrans.reset (new parallel::distributed::SolutionTransfer<dim,TrilinosWrappers::MPI::Vector>(dof_handler));
                refine_grid ();
+               computing_timer.exit_section("Setup: refine mesh");
           }
 
         setup_system ();
@@ -1511,7 +1518,7 @@ namespace Step42
                solution = distributed_solution;
           }
 
-        computing_timer.exit_section("Mesh refinement and setup system");
+        computing_timer.exit_section("Setup");
 
         solve_newton ();
 
@@ -1526,7 +1533,6 @@ namespace Step42
         computing_timer.exit_section("Graphical output");
 
         computing_timer.print_summary();
-        computing_timer.disable_output();
       }
   }
 }

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.