From 571a61bcbce8b33a364ccde69d711a8ba62a77c9 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Sun, 5 Mar 2017 16:00:15 +0100 Subject: [PATCH] Fix multigrid mpi tests by better output --- tests/multigrid/mg_coarse_01.cc | 46 +++--- ...st=true.with_trilinos=true.mpirun=1.output | 139 +++++++++--------- ...st=true.with_trilinos=true.mpirun=3.output | 139 +++++++++--------- tests/multigrid/step-50_01.cc | 37 ++--- ...st=true.with_trilinos=true.mpirun=1.output | 79 +++++----- ...st=true.with_trilinos=true.mpirun=5.output | 79 +++++----- ...st=true.with_trilinos=true.mpirun=8.output | 79 +++++----- 7 files changed, 300 insertions(+), 298 deletions(-) diff --git a/tests/multigrid/mg_coarse_01.cc b/tests/multigrid/mg_coarse_01.cc index 5f65bac14c..ed557e61bf 100644 --- a/tests/multigrid/mg_coarse_01.cc +++ b/tests/multigrid/mg_coarse_01.cc @@ -100,8 +100,6 @@ namespace Step50 void refine_grid (); void output_results (const unsigned int cycle) const; - ConditionalOStream pcout; - parallel::distributed::Triangulation triangulation; FE_Q fe; DoFHandler mg_dof_handler; @@ -181,9 +179,6 @@ namespace Step50 template LaplaceProblem::LaplaceProblem (const unsigned int degree) : - pcout (std::cout, - (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - == 0)), triangulation (MPI_COMM_WORLD,Triangulation:: limit_level_difference_at_vertices, parallel::distributed::Triangulation::construct_multigrid_hierarchy), @@ -481,7 +476,7 @@ namespace Step50 preconditioner.vmult(check2, tmp); check3.sadd(0.75, 0.25, check2); double residual = system_matrix.residual(tmp, check3, system_rhs); - pcout << "check residual:" << residual << std::endl; + deallog << "check residual: " << residual << std::endl; } } @@ -496,7 +491,7 @@ namespace Step50 SolverCG coarse_solver(coarse_solver_control); { - pcout << "CG(ID):" << std::endl; + deallog << "CG(ID):" << std::endl; PreconditionIdentity id; @@ -508,11 +503,11 @@ namespace Step50 id); vcycle(coarse_grid_solver); - pcout << "coarse iterations: " << coarse_solver_control.last_step() << std::endl; + deallog << "coarse iterations: " << coarse_solver_control.last_step() << std::endl; } { - pcout << "CG(ILU):" << std::endl; + deallog << "CG(ILU):" << std::endl; LA::MPI::PreconditionILU prec; prec.initialize(coarse_matrix); @@ -525,11 +520,11 @@ namespace Step50 prec); vcycle(coarse_grid_solver); - pcout << "coarse iterations: " << coarse_solver_control.last_step() << std::endl; + deallog << "coarse iterations: " << coarse_solver_control.last_step() << std::endl; } { - pcout << "CG(AMG):" << std::endl; + deallog << "CG(AMG):" << std::endl; LA::MPI::PreconditionAMG prec; prec.initialize(coarse_matrix); @@ -542,11 +537,11 @@ namespace Step50 prec); vcycle(coarse_grid_solver); - pcout << "coarse iterations: " << coarse_solver_control.last_step() << std::endl; + deallog << "coarse iterations: " << coarse_solver_control.last_step() << std::endl; } { - pcout << "AMG:" << std::endl; + deallog << "AMG:" << std::endl; LA::MPI::PreconditionAMG::AdditionalData Amg_data; Amg_data.elliptic = true; Amg_data.higher_order_elements = true; @@ -555,7 +550,7 @@ namespace Step50 MGCoarseAMG coarse_grid_solver(coarse_matrix, Amg_data); vcycle(coarse_grid_solver); - pcout << "applications: " << coarse_grid_solver.count << std::endl; + deallog << "applications: " << coarse_grid_solver.count << std::endl; } } @@ -596,7 +591,7 @@ namespace Step50 { for (unsigned int cycle=0; cycle<3; ++cycle) { - pcout << "Cycle " << cycle << ':' << std::endl; + deallog << "Cycle " << cycle << ':' << std::endl; { unsigned int n_subdiv = 6+5*cycle; @@ -605,20 +600,20 @@ namespace Step50 triangulation.refine_global(1); } - pcout << " Number of active cells: " - << triangulation.n_global_active_cells() - << std::endl; + deallog << " Number of active cells: " + << triangulation.n_global_active_cells() + << std::endl; setup_system (); - pcout << " Number of degrees of freedom: " - << mg_dof_handler.n_dofs() - << " (by level: "; + deallog << " Number of degrees of freedom: " + << mg_dof_handler.n_dofs() + << " (by level: "; for (unsigned int level=0; level triangulation; FE_Q fe; DoFHandler mg_dof_handler; @@ -179,9 +177,6 @@ namespace Step50 template LaplaceProblem::LaplaceProblem (const unsigned int degree) : - pcout (std::cout, - (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) - == 0)), triangulation (MPI_COMM_WORLD,Triangulation:: limit_level_difference_at_vertices, parallel::distributed::Triangulation::construct_multigrid_hierarchy), @@ -407,9 +402,9 @@ namespace Step50 for (unsigned int i=0; i @@ -522,7 +516,7 @@ namespace Step50 { for (unsigned int cycle=0; cycle<2; ++cycle) { - pcout << "Cycle " << cycle << ':' << std::endl; + deallog << "Cycle " << cycle << ':' << std::endl; if (cycle == 0) { @@ -554,20 +548,20 @@ namespace Step50 else triangulation.refine_global (); - pcout << " Number of active cells: " - << triangulation.n_global_active_cells() - << std::endl; + deallog << " Number of active cells: " + << triangulation.n_global_active_cells() + << std::endl; setup_system (); - pcout << " Number of degrees of freedom: " - << mg_dof_handler.n_dofs() - << " (by level: "; + deallog << " Number of degrees of freedom: " + << mg_dof_handler.n_dofs() + << " (by level: "; for (unsigned int level=0; level