From: heister Date: Wed, 27 Mar 2013 03:46:26 +0000 (+0000) Subject: switch tests to MPI_InitFinalize (some more to come) X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7b6ca77698f9244581c2a32e8aa85aff2e65115;p=dealii-svn.git switch tests to MPI_InitFinalize (some more to come) git-svn-id: https://svn.dealii.org/trunk@29054 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/mpi/constraint_matrix_condense_01.cc b/tests/mpi/constraint_matrix_condense_01.cc index 206e9cae55..01006c6a15 100644 --- a/tests/mpi/constraint_matrix_condense_01.cc +++ b/tests/mpi/constraint_matrix_condense_01.cc @@ -76,7 +76,7 @@ void test () int main(int argc, char *argv[]) { Utilities::MPI::MPI_InitFinalize mpi (argc, argv); - PetscInitialize(&argc,&argv,0,0); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -95,6 +95,6 @@ int main(int argc, char *argv[]) else test(); - PetscFinalize(); + return 0; } diff --git a/tests/mpi/ghost_02.cc b/tests/mpi/ghost_02.cc index f4bf72c06b..47a22bdf6a 100644 --- a/tests/mpi/ghost_02.cc +++ b/tests/mpi/ghost_02.cc @@ -93,7 +93,7 @@ void test () int main (int argc, char **argv) { - PetscInitialize(&argc,&argv,0,0); + 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)); @@ -111,5 +111,5 @@ int main (int argc, char **argv) else test(); - PetscFinalize(); + } diff --git a/tests/mpi/interpolate_02.cc b/tests/mpi/interpolate_02.cc index dd18b3f838..94f068e666 100644 --- a/tests/mpi/interpolate_02.cc +++ b/tests/mpi/interpolate_02.cc @@ -78,7 +78,7 @@ void test() int main(int argc, char *argv[]) { - PetscInitialize(&argc,&argv,0,0); + 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)); @@ -103,5 +103,5 @@ int main(int argc, char *argv[]) test<3>(); } - PetscFinalize(); + } diff --git a/tests/mpi/p4est_2d_constraintmatrix_03.cc b/tests/mpi/p4est_2d_constraintmatrix_03.cc index 94a8b655bd..8d147e39dd 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_03.cc @@ -223,12 +223,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -249,7 +244,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_constraintmatrix_04.cc b/tests/mpi/p4est_2d_constraintmatrix_04.cc index 9bcb2882ae..e934681168 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_04.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_04.cc @@ -325,12 +325,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -351,7 +346,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_constraintmatrix_05.cc b/tests/mpi/p4est_2d_constraintmatrix_05.cc index 4df41363d4..7dcc1222a3 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_05.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_05.cc @@ -95,12 +95,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -121,7 +116,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_dofhandler_01.cc b/tests/mpi/p4est_2d_dofhandler_01.cc index 8be5e60112..3e45bd9095 100644 --- a/tests/mpi/p4est_2d_dofhandler_01.cc +++ b/tests/mpi/p4est_2d_dofhandler_01.cc @@ -82,12 +82,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -107,8 +102,4 @@ int main(int argc, char *argv[]) } else test<2>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_dofhandler_02.cc b/tests/mpi/p4est_2d_dofhandler_02.cc index 3e8bded9a6..3ada5930fe 100644 --- a/tests/mpi/p4est_2d_dofhandler_02.cc +++ b/tests/mpi/p4est_2d_dofhandler_02.cc @@ -95,12 +95,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -121,7 +116,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_dofhandler_03.cc b/tests/mpi/p4est_2d_dofhandler_03.cc index 1ea989642b..5e286651d9 100644 --- a/tests/mpi/p4est_2d_dofhandler_03.cc +++ b/tests/mpi/p4est_2d_dofhandler_03.cc @@ -114,12 +114,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -140,7 +135,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_dofhandler_04.cc b/tests/mpi/p4est_2d_dofhandler_04.cc index 8f5e05fd1b..c6203d8d00 100644 --- a/tests/mpi/p4est_2d_dofhandler_04.cc +++ b/tests/mpi/p4est_2d_dofhandler_04.cc @@ -124,12 +124,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -150,7 +145,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_dofhandler_05.cc b/tests/mpi/p4est_2d_dofhandler_05.cc index f5926eeb02..3a9edbc114 100644 --- a/tests/mpi/p4est_2d_dofhandler_05.cc +++ b/tests/mpi/p4est_2d_dofhandler_05.cc @@ -62,12 +62,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -88,7 +83,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_ghost_01.cc b/tests/mpi/p4est_2d_ghost_01.cc index 46b887ea0c..f02f798d84 100644 --- a/tests/mpi/p4est_2d_ghost_01.cc +++ b/tests/mpi/p4est_2d_ghost_01.cc @@ -110,12 +110,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -136,8 +131,4 @@ int main(int argc, char *argv[]) else test<2>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_ghost_02.cc b/tests/mpi/p4est_2d_ghost_02.cc index 6c63431c49..473663cbeb 100644 --- a/tests/mpi/p4est_2d_ghost_02.cc +++ b/tests/mpi/p4est_2d_ghost_02.cc @@ -112,12 +112,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -138,8 +133,4 @@ int main(int argc, char *argv[]) else test<2>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_refine_01.cc b/tests/mpi/p4est_2d_refine_01.cc index 1dd9f3bb06..87d8e9b934 100644 --- a/tests/mpi/p4est_2d_refine_01.cc +++ b/tests/mpi/p4est_2d_refine_01.cc @@ -76,12 +76,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -102,8 +97,4 @@ int main(int argc, char *argv[]) else test<2>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_refine_02.cc b/tests/mpi/p4est_2d_refine_02.cc index 54d5dd488f..bd0bfb60cd 100644 --- a/tests/mpi/p4est_2d_refine_02.cc +++ b/tests/mpi/p4est_2d_refine_02.cc @@ -67,12 +67,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -93,8 +88,4 @@ int main(int argc, char *argv[]) else test<2>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_refine_03.cc b/tests/mpi/p4est_2d_refine_03.cc index eeeaca44e4..7feb0aada1 100644 --- a/tests/mpi/p4est_2d_refine_03.cc +++ b/tests/mpi/p4est_2d_refine_03.cc @@ -86,12 +86,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -112,7 +107,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_renumber_01.cc b/tests/mpi/p4est_2d_renumber_01.cc index 1d943b376d..6d017c1799 100644 --- a/tests/mpi/p4est_2d_renumber_01.cc +++ b/tests/mpi/p4est_2d_renumber_01.cc @@ -114,12 +114,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -152,7 +147,4 @@ int main(int argc, char *argv[]) deallog.pop(); } -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_renumber_02.cc b/tests/mpi/p4est_2d_renumber_02.cc index 537fcf3d37..7b50284301 100644 --- a/tests/mpi/p4est_2d_renumber_02.cc +++ b/tests/mpi/p4est_2d_renumber_02.cc @@ -111,12 +111,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -141,7 +136,4 @@ int main(int argc, char *argv[]) deallog.pop(); } -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_2d_simple.cc b/tests/mpi/p4est_2d_simple.cc index ed6c6e0331..3f7c087ca3 100644 --- a/tests/mpi/p4est_2d_simple.cc +++ b/tests/mpi/p4est_2d_simple.cc @@ -79,12 +79,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -102,8 +97,4 @@ int main(int argc, char *argv[]) else test<2>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_3d_constraintmatrix_01.cc b/tests/mpi/p4est_3d_constraintmatrix_01.cc index 753b3a2ed9..8f5a02a221 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_01.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_01.cc @@ -101,12 +101,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -127,7 +122,4 @@ int main(int argc, char *argv[]) else test<3>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_3d_constraintmatrix_02.cc b/tests/mpi/p4est_3d_constraintmatrix_02.cc index a99940a5bf..9bc8636906 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_02.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_02.cc @@ -131,12 +131,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -157,7 +152,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_3d_constraintmatrix_03.cc b/tests/mpi/p4est_3d_constraintmatrix_03.cc index 080246484a..8e87deb5a7 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_03.cc @@ -322,12 +322,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -347,8 +342,4 @@ int main(int argc, char *argv[]) } else test<3>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_3d_ghost_01.cc b/tests/mpi/p4est_3d_ghost_01.cc index f27065b5bb..9f0254eab9 100644 --- a/tests/mpi/p4est_3d_ghost_01.cc +++ b/tests/mpi/p4est_3d_ghost_01.cc @@ -121,12 +121,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -150,8 +145,4 @@ int main(int argc, char *argv[]) else test<3>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_3d_refine_01.cc b/tests/mpi/p4est_3d_refine_01.cc index 04bbbb0443..e5d1777f46 100644 --- a/tests/mpi/p4est_3d_refine_01.cc +++ b/tests/mpi/p4est_3d_refine_01.cc @@ -115,12 +115,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -141,8 +136,4 @@ int main(int argc, char *argv[]) else test<3>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_3d_refine_02.cc b/tests/mpi/p4est_3d_refine_02.cc index 2fec8db309..c772479b6b 100644 --- a/tests/mpi/p4est_3d_refine_02.cc +++ b/tests/mpi/p4est_3d_refine_02.cc @@ -76,12 +76,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -102,8 +97,4 @@ int main(int argc, char *argv[]) else test<3>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_3d_refine_03.cc b/tests/mpi/p4est_3d_refine_03.cc index 7960755914..2fa5be4c96 100644 --- a/tests/mpi/p4est_3d_refine_03.cc +++ b/tests/mpi/p4est_3d_refine_03.cc @@ -73,12 +73,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -99,8 +94,4 @@ int main(int argc, char *argv[]) else test<3>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_3d_refine_04.cc b/tests/mpi/p4est_3d_refine_04.cc index b69e5089fb..30efe6aa37 100644 --- a/tests/mpi/p4est_3d_refine_04.cc +++ b/tests/mpi/p4est_3d_refine_04.cc @@ -113,12 +113,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -139,8 +134,4 @@ int main(int argc, char *argv[]) else test<3>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_data_out_01.cc b/tests/mpi/p4est_data_out_01.cc index e552669d3b..80c96c2146 100644 --- a/tests/mpi/p4est_data_out_01.cc +++ b/tests/mpi/p4est_data_out_01.cc @@ -79,12 +79,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -105,7 +100,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_get_subdomain_association.cc b/tests/mpi/p4est_get_subdomain_association.cc index 3acf723e36..8248475e5d 100644 --- a/tests/mpi/p4est_get_subdomain_association.cc +++ b/tests/mpi/p4est_get_subdomain_association.cc @@ -74,12 +74,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -100,7 +95,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_max_refine.cc b/tests/mpi/p4est_max_refine.cc index e5cf1d18ff..dde67aefac 100644 --- a/tests/mpi/p4est_max_refine.cc +++ b/tests/mpi/p4est_max_refine.cc @@ -75,13 +75,8 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif - + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -102,7 +97,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/p4est_save_01.cc b/tests/mpi/p4est_save_01.cc index 44cb7bed53..b79f172c2c 100644 --- a/tests/mpi/p4est_save_01.cc +++ b/tests/mpi/p4est_save_01.cc @@ -103,14 +103,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - PetscInitialize(&argc,&argv,0,0); - -// MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -131,10 +124,4 @@ int main(int argc, char *argv[]) else test<2>(); - -#ifdef DEAL_II_WITH_MPI - //MPI_Finalize(); - PetscFinalize(); - -#endif } diff --git a/tests/mpi/p4est_save_02.cc b/tests/mpi/p4est_save_02.cc index 09709fa8de..9bd7e49e04 100644 --- a/tests/mpi/p4est_save_02.cc +++ b/tests/mpi/p4est_save_02.cc @@ -158,14 +158,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - PetscInitialize(&argc,&argv,0,0); - -// MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -186,10 +179,4 @@ int main(int argc, char *argv[]) else test<2>(); - -#ifdef DEAL_II_WITH_MPI - //MPI_Finalize(); - PetscFinalize(); - -#endif } diff --git a/tests/mpi/p4est_save_03.cc b/tests/mpi/p4est_save_03.cc index 41d5034603..015d3ef1db 100644 --- a/tests/mpi/p4est_save_03.cc +++ b/tests/mpi/p4est_save_03.cc @@ -171,15 +171,8 @@ void test() int main (int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - PetscInitialize (&argc, &argv, 0, 0); - -// MPI_Init (&argc,&argv); -#else - (void) argc; - (void) argv; -#endif - + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -199,10 +192,4 @@ int main (int argc, char *argv[]) else test<2>(); - -#ifdef DEAL_II_WITH_MPI - //MPI_Finalize(); - PetscFinalize(); - -#endif } diff --git a/tests/mpi/petsc_02.cc b/tests/mpi/petsc_02.cc index 4de69e5d56..9bbd2d4200 100644 --- a/tests/mpi/petsc_02.cc +++ b/tests/mpi/petsc_02.cc @@ -59,7 +59,7 @@ void test() int main(int argc, char *argv[]) { - PetscInitialize(&argc,&argv,0,0); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { @@ -73,5 +73,5 @@ int main(int argc, char *argv[]) else test(); - PetscFinalize(); + } diff --git a/tests/mpi/point_to_point_pattern_01.cc b/tests/mpi/point_to_point_pattern_01.cc index c1e6dd28f3..c28c7fd050 100644 --- a/tests/mpi/point_to_point_pattern_01.cc +++ b/tests/mpi/point_to_point_pattern_01.cc @@ -105,14 +105,7 @@ void test_mpi() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi (argc, argv); -#else - (void)argc; - (void)argv; - compile_time_error; - -#endif if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc index 382e90fbfb..8cdb8bdcaf 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc @@ -124,12 +124,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -148,8 +143,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc index 71826f84f6..50cb091223 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc @@ -134,12 +134,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -158,8 +153,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc index 8d5f505096..103390ad3c 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc @@ -113,12 +113,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -137,8 +132,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc index 2eb21b48d2..65695a8b80 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc @@ -131,12 +131,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -155,8 +150,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc index aee20a5a28..15ac20e454 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc @@ -128,12 +128,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -152,8 +147,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc index af06f798b2..68b6c0832c 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc @@ -146,12 +146,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -170,8 +165,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_number_01.cc b/tests/mpi/refine_and_coarsen_fixed_number_01.cc index 115a29b2e8..4c59db72e0 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_01.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_01.cc @@ -112,12 +112,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -136,8 +131,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_number_02.cc b/tests/mpi/refine_and_coarsen_fixed_number_02.cc index 4f82555782..730b31a7cc 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_02.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_02.cc @@ -113,12 +113,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -137,8 +132,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_number_03.cc b/tests/mpi/refine_and_coarsen_fixed_number_03.cc index 7e44e23fe7..770bbbf09e 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_03.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_03.cc @@ -102,12 +102,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -126,8 +121,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_number_04.cc b/tests/mpi/refine_and_coarsen_fixed_number_04.cc index f2e9ebc39e..abf3490809 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_04.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_04.cc @@ -131,12 +131,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -155,8 +150,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_number_05.cc b/tests/mpi/refine_and_coarsen_fixed_number_05.cc index 307bc3dbe3..06b7db2c3c 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_05.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_05.cc @@ -128,12 +128,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -152,8 +147,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refine_and_coarsen_fixed_number_06.cc b/tests/mpi/refine_and_coarsen_fixed_number_06.cc index 6d951deaa6..93fc4d1422 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_06.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_06.cc @@ -67,12 +67,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { @@ -86,7 +81,4 @@ int main(int argc, char *argv[]) else test<2>(); -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refinement_listener_01.cc b/tests/mpi/refinement_listener_01.cc index 38cc730408..ad08be796e 100644 --- a/tests/mpi/refinement_listener_01.cc +++ b/tests/mpi/refinement_listener_01.cc @@ -82,12 +82,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_COMPILER_SUPPORTS_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -106,8 +101,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_COMPILER_SUPPORTS_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/refinement_listener_02.cc b/tests/mpi/refinement_listener_02.cc index e90b0613ab..c48a1b033b 100644 --- a/tests/mpi/refinement_listener_02.cc +++ b/tests/mpi/refinement_listener_02.cc @@ -85,12 +85,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_COMPILER_SUPPORTS_MPI - MPI_Init (&argc,&argv); -#else - (void)argc; - (void)argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -109,8 +104,4 @@ int main(int argc, char *argv[]) else test(); - -#ifdef DEAL_II_COMPILER_SUPPORTS_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/renumber_z_order_01.cc b/tests/mpi/renumber_z_order_01.cc index a73cdfd12c..cb9e5d33d0 100644 --- a/tests/mpi/renumber_z_order_01.cc +++ b/tests/mpi/renumber_z_order_01.cc @@ -118,12 +118,7 @@ void test() int main (int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc, &argv); -#else - (void) argc; - (void) argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -143,8 +138,4 @@ int main (int argc, char *argv[]) } else test<2>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/renumber_z_order_02.cc b/tests/mpi/renumber_z_order_02.cc index 1cc055aeb6..3547bb9ece 100644 --- a/tests/mpi/renumber_z_order_02.cc +++ b/tests/mpi/renumber_z_order_02.cc @@ -125,12 +125,7 @@ void test() int main (int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI - MPI_Init (&argc, &argv); -#else - (void) argc; - (void) argv; -#endif + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -150,8 +145,4 @@ int main (int argc, char *argv[]) } else test<2>(); - -#ifdef DEAL_II_WITH_MPI - MPI_Finalize(); -#endif } diff --git a/tests/mpi/simple_mpi_01.cc b/tests/mpi/simple_mpi_01.cc index 826909127e..95b3b84f4b 100644 --- a/tests/mpi/simple_mpi_01.cc +++ b/tests/mpi/simple_mpi_01.cc @@ -62,14 +62,7 @@ void test_mpi() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi (argc, argv); -#else - (void)argc; - (void)argv; - compile_time_error; - -#endif if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { diff --git a/tests/mpi/solution_transfer_01.cc b/tests/mpi/solution_transfer_01.cc index 3336900e5f..26c800bece 100644 --- a/tests/mpi/solution_transfer_01.cc +++ b/tests/mpi/solution_transfer_01.cc @@ -99,7 +99,7 @@ void test() int main(int argc, char *argv[]) { - PetscInitialize(&argc,&argv,0,0); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); @@ -127,5 +127,5 @@ int main(int argc, char *argv[]) test<3>(); } - PetscFinalize(); + }