From: David Wells Date: Fri, 3 Jun 2022 20:20:45 +0000 (-0400) Subject: Remove unnecessary MPI initialization from SUNDIALS programs. X-Git-Tag: v9.4.0-rc1~67^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13902%2Fhead;p=dealii.git Remove unnecessary MPI initialization from SUNDIALS programs. --- diff --git a/examples/step-77/step-77.cc b/examples/step-77/step-77.cc index 38c5559a73..3f8a5bc379 100644 --- a/examples/step-77/step-77.cc +++ b/examples/step-77/step-77.cc @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -641,19 +640,11 @@ namespace Step77 } // namespace Step77 -int main(int argc, char **argv) +int main() { try { using namespace Step77; -#ifdef DEAL_II_WITH_MPI - dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, - argv, - 1); -#else - (void)argc; - (void)argv; -#endif MinimalSurfaceProblem<2> laplace_problem_2d; laplace_problem_2d.run(); diff --git a/tests/sundials/arkode_01.cc b/tests/sundials/arkode_01.cc index b5c66a44bf..e559e97ea1 100644 --- a/tests/sundials/arkode_01.cc +++ b/tests/sundials/arkode_01.cc @@ -50,13 +50,10 @@ * y[1](t) = k cos(k t) */ int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; ParameterHandler prm; diff --git a/tests/sundials/arkode_02.cc b/tests/sundials/arkode_02.cc index bd42dc9662..3059f38e07 100644 --- a/tests/sundials/arkode_02.cc +++ b/tests/sundials/arkode_02.cc @@ -50,13 +50,10 @@ * y[1](t) = k cos(k t) */ int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; ParameterHandler prm; diff --git a/tests/sundials/arkode_03.cc b/tests/sundials/arkode_03.cc index 941d0c2ef2..9fbdccae8a 100644 --- a/tests/sundials/arkode_03.cc +++ b/tests/sundials/arkode_03.cc @@ -47,13 +47,10 @@ * eps in right hand side of the third equation). */ int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = LinearAlgebra::distributed::Vector; ParameterHandler prm; diff --git a/tests/sundials/arkode_04.cc b/tests/sundials/arkode_04.cc index 5d3f2ad19f..d215d983fb 100644 --- a/tests/sundials/arkode_04.cc +++ b/tests/sundials/arkode_04.cc @@ -47,13 +47,10 @@ * eps in right hand side of the third equation). */ int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; ParameterHandler prm; diff --git a/tests/sundials/arkode_05.cc b/tests/sundials/arkode_05.cc index 72599be910..526eb7fc22 100644 --- a/tests/sundials/arkode_05.cc +++ b/tests/sundials/arkode_05.cc @@ -47,13 +47,10 @@ * eps in right hand side of the third equation). */ int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; ParameterHandler prm; diff --git a/tests/sundials/arkode_06.cc b/tests/sundials/arkode_06.cc index 1175070796..ba1a619afc 100644 --- a/tests/sundials/arkode_06.cc +++ b/tests/sundials/arkode_06.cc @@ -52,15 +52,12 @@ * eps in right hand side of the third equation). */ int -main(int argc, char **argv) +main() { initlog(); // restrict output to highest level deallog.depth_file(1); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; ParameterHandler prm; diff --git a/tests/sundials/arkode_07.cc b/tests/sundials/arkode_07.cc index f0ae77f5d8..57779f7bab 100644 --- a/tests/sundials/arkode_07.cc +++ b/tests/sundials/arkode_07.cc @@ -52,15 +52,12 @@ * eps in right hand side of the third equation). */ int -main(int argc, char **argv) +main() { initlog(); // restrict output to highest level deallog.depth_file(1); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; ParameterHandler prm; diff --git a/tests/sundials/arkode_08.cc b/tests/sundials/arkode_08.cc index 3dfa856ef3..5fb8af7db5 100644 --- a/tests/sundials/arkode_08.cc +++ b/tests/sundials/arkode_08.cc @@ -47,13 +47,10 @@ * with SUNDIALS nomenclature. */ int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; ParameterHandler prm; diff --git a/tests/sundials/arkode_repeated_solve.cc b/tests/sundials/arkode_repeated_solve.cc index d60a5bf235..e63f783046 100644 --- a/tests/sundials/arkode_repeated_solve.cc +++ b/tests/sundials/arkode_repeated_solve.cc @@ -58,13 +58,10 @@ create_solver() } int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - auto ode = create_solver(); { Vector y(2); diff --git a/tests/sundials/ida_01.cc b/tests/sundials/ida_01.cc index 7fa93d3e43..d83ae344e9 100644 --- a/tests/sundials/ida_01.cc +++ b/tests/sundials/ida_01.cc @@ -142,10 +142,8 @@ private: int -main(int argc, char **argv) +main() { - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); initlog(); deallog << std::setprecision(10); diff --git a/tests/sundials/ida_02.cc b/tests/sundials/ida_02.cc index ea94760cdf..e6c8359670 100644 --- a/tests/sundials/ida_02.cc +++ b/tests/sundials/ida_02.cc @@ -139,10 +139,8 @@ private: int -main(int argc, char **argv) +main() { - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); initlog(); deallog << std::setprecision(10); diff --git a/tests/sundials/kinsol_01.cc b/tests/sundials/kinsol_01.cc index 028491fcea..9224bdf423 100644 --- a/tests/sundials/kinsol_01.cc +++ b/tests/sundials/kinsol_01.cc @@ -40,13 +40,10 @@ * Run statistics (optional outputs) are printed at the end. */ int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; SUNDIALS::KINSOL::AdditionalData data; diff --git a/tests/sundials/kinsol_02.cc b/tests/sundials/kinsol_02.cc index dc56917859..5c8574a767 100644 --- a/tests/sundials/kinsol_02.cc +++ b/tests/sundials/kinsol_02.cc @@ -35,13 +35,10 @@ // N_i(u) = .1*u_i^2 - i - 1 // int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; // Size of the problem diff --git a/tests/sundials/kinsol_03.cc b/tests/sundials/kinsol_03.cc index 8e5c763ec2..e90968e733 100644 --- a/tests/sundials/kinsol_03.cc +++ b/tests/sundials/kinsol_03.cc @@ -45,13 +45,10 @@ // know what to linearize around. The _04 test fixes this by computing // the Jacobian in the setup function. int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; SUNDIALS::KINSOL::AdditionalData data; diff --git a/tests/sundials/kinsol_03_new_interface.cc b/tests/sundials/kinsol_03_new_interface.cc index bd36f20ee4..11ab7f3c50 100644 --- a/tests/sundials/kinsol_03_new_interface.cc +++ b/tests/sundials/kinsol_03_new_interface.cc @@ -45,13 +45,10 @@ // know what to linearize around. The _04 test fixes this by computing // the Jacobian in the setup function. int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; SUNDIALS::KINSOL::AdditionalData data; diff --git a/tests/sundials/kinsol_04.cc b/tests/sundials/kinsol_04.cc index 4b28a7ea9e..a499ad1afc 100644 --- a/tests/sundials/kinsol_04.cc +++ b/tests/sundials/kinsol_04.cc @@ -57,13 +57,10 @@ // iteration and, unsurprisingly, converges much quicker. int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; SUNDIALS::KINSOL::AdditionalData data; diff --git a/tests/sundials/kinsol_04_new_interface.cc b/tests/sundials/kinsol_04_new_interface.cc index 825a5eff48..f4435d7911 100644 --- a/tests/sundials/kinsol_04_new_interface.cc +++ b/tests/sundials/kinsol_04_new_interface.cc @@ -57,13 +57,10 @@ // iteration and, unsurprisingly, converges much quicker. int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; SUNDIALS::KINSOL::AdditionalData data; diff --git a/tests/sundials/kinsol_05.cc b/tests/sundials/kinsol_05.cc index 08ca0854a8..9e8f2046e5 100644 --- a/tests/sundials/kinsol_05.cc +++ b/tests/sundials/kinsol_05.cc @@ -51,13 +51,10 @@ // finally updates it in every iteration. int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; SUNDIALS::KINSOL::AdditionalData data; diff --git a/tests/sundials/kinsol_05_new_interface.cc b/tests/sundials/kinsol_05_new_interface.cc index d0e9b8edf9..09d40c03c7 100644 --- a/tests/sundials/kinsol_05_new_interface.cc +++ b/tests/sundials/kinsol_05_new_interface.cc @@ -51,13 +51,10 @@ // finally updates it in every iteration. int -main(int argc, char **argv) +main() { initlog(); - Utilities::MPI::MPI_InitFinalize mpi_initialization( - argc, argv, numbers::invalid_unsigned_int); - using VectorType = Vector; SUNDIALS::KINSOL::AdditionalData data; diff --git a/tests/sundials/step-77.cc b/tests/sundials/step-77.cc index 0fbf7b1305..32444acc3d 100644 --- a/tests/sundials/step-77.cc +++ b/tests/sundials/step-77.cc @@ -454,17 +454,10 @@ namespace Step77 int -main(int argc, char **argv) +main() { initlog(); using namespace Step77; - // SUNDIALS will duplicate communicators even if we are running in serial -#ifdef DEAL_II_WITH_MPI - dealii::Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); -#else - (void)argc; - (void)argv; -#endif MinimalSurfaceProblem<2> laplace_problem_2d; laplace_problem_2d.run();