]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify logfile setup in some tests 10025/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 3 May 2020 09:07:30 +0000 (11:07 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 3 May 2020 09:07:30 +0000 (11:07 +0200)
tests/matrix_free/laplace_operator_01.cc
tests/matrix_free/laplace_operator_02.cc
tests/matrix_free/mass_operator_01.cc
tests/matrix_free/mass_operator_02.cc
tests/matrix_free/mass_operator_03.cc

index 3d65339ec4672eab42c3b1f94c3e2d51e4ce9a1d..6f75c7175c1b682d2f3459a2cc2cd6c95caa7ed0 100644 (file)
@@ -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();
 }
index a88bd4b8d5808aedef1d7bdff94348d77a79a6e0..9f1863eeca4a82f5a2c206e040489737b8469f74 100644 (file)
@@ -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();
 }
index 31676da9c8c9c48aff7adab64b462a221021674c..761051b24f072e620bfeddc9517d4ce25d0a6315 100644 (file)
@@ -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();
 }
index 2fff37b8586ca32bd6d2c24b564a3e332c636550..85c94e6089007dc46986b473bda30089239ae3ad 100644 (file)
@@ -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();
 
index 0bc6d1ea1ec9c2fc86130cd6ca2a4def53ef6aff..fe38be5f627e7371ec5c35d6e7c4bcb03439e68a 100644 (file)
@@ -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();
 

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.