From 77be51f04c139bce3268a10d7b3f0c4c82d5aee1 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Sun, 3 May 2020 11:07:30 +0200 Subject: [PATCH] Simplify logfile setup in some tests --- tests/matrix_free/laplace_operator_01.cc | 38 ++++++++---------------- tests/matrix_free/laplace_operator_02.cc | 38 ++++++++---------------- tests/matrix_free/mass_operator_01.cc | 38 ++++++++---------------- tests/matrix_free/mass_operator_02.cc | 3 +- tests/matrix_free/mass_operator_03.cc | 3 +- 5 files changed, 38 insertions(+), 82 deletions(-) diff --git a/tests/matrix_free/laplace_operator_01.cc b/tests/matrix_free/laplace_operator_01.cc index 3d65339ec4..6f75c7175c 100644 --- a/tests/matrix_free/laplace_operator_01.cc +++ b/tests/matrix_free/laplace_operator_01.cc @@ -203,32 +203,18 @@ test() int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, testing_max_num_threads()); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); - deallog.push(Utilities::int_to_string(myid)); + mpi_initlog(); + deallog.push("0"); - if (myid == 0) - { - initlog(); - deallog << std::setprecision(4); - - deallog.push("2d"); - test<2, 1>(); - test<2, 2>(); - deallog.pop(); - - deallog.push("3d"); - test<3, 1>(); - test<3, 2>(); - deallog.pop(); - } - else - { - test<2, 1>(); - test<2, 2>(); - test<3, 1>(); - test<3, 2>(); - } + deallog.push("2d"); + test<2, 1>(); + test<2, 2>(); + deallog.pop(); + + deallog.push("3d"); + test<3, 1>(); + test<3, 2>(); + deallog.pop(); } diff --git a/tests/matrix_free/laplace_operator_02.cc b/tests/matrix_free/laplace_operator_02.cc index a88bd4b8d5..9f1863eeca 100644 --- a/tests/matrix_free/laplace_operator_02.cc +++ b/tests/matrix_free/laplace_operator_02.cc @@ -267,32 +267,18 @@ test() int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, testing_max_num_threads()); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); - deallog.push(Utilities::int_to_string(myid)); + mpi_initlog(); + deallog.push("0"); - if (myid == 0) - { - initlog(); - deallog << std::setprecision(4); - - deallog.push("2d"); - test<2, 1>(); - test<2, 2>(); - deallog.pop(); - - deallog.push("3d"); - test<3, 1>(); - test<3, 2>(); - deallog.pop(); - } - else - { - test<2, 1>(); - test<2, 2>(); - test<3, 1>(); - test<3, 2>(); - } + deallog.push("2d"); + test<2, 1>(); + test<2, 2>(); + deallog.pop(); + + deallog.push("3d"); + test<3, 1>(); + test<3, 2>(); + deallog.pop(); } diff --git a/tests/matrix_free/mass_operator_01.cc b/tests/matrix_free/mass_operator_01.cc index 31676da9c8..761051b24f 100644 --- a/tests/matrix_free/mass_operator_01.cc +++ b/tests/matrix_free/mass_operator_01.cc @@ -211,32 +211,18 @@ test() int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, testing_max_num_threads()); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - unsigned int myid = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); - deallog.push(Utilities::int_to_string(myid)); + mpi_initlog(); + deallog.push("0"); - if (myid == 0) - { - initlog(); - deallog << std::setprecision(4); - - deallog.push("2d"); - test<2, 1>(); - test<2, 2>(); - deallog.pop(); - - deallog.push("3d"); - test<3, 1>(); - test<3, 2>(); - deallog.pop(); - } - else - { - test<2, 1>(); - test<2, 2>(); - test<3, 1>(); - test<3, 2>(); - } + deallog.push("2d"); + test<2, 1>(); + test<2, 2>(); + deallog.pop(); + + deallog.push("3d"); + test<3, 1>(); + test<3, 2>(); + deallog.pop(); } diff --git a/tests/matrix_free/mass_operator_02.cc b/tests/matrix_free/mass_operator_02.cc index 2fff37b858..85c94e6089 100644 --- a/tests/matrix_free/mass_operator_02.cc +++ b/tests/matrix_free/mass_operator_02.cc @@ -194,8 +194,7 @@ test() int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, testing_max_num_threads()); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); mpi_initlog(); diff --git a/tests/matrix_free/mass_operator_03.cc b/tests/matrix_free/mass_operator_03.cc index 0bc6d1ea1e..fe38be5f62 100644 --- a/tests/matrix_free/mass_operator_03.cc +++ b/tests/matrix_free/mass_operator_03.cc @@ -191,8 +191,7 @@ test() int main(int argc, char **argv) { - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, testing_max_num_threads()); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); mpi_initlog(); -- 2.39.5