]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove unnecessary MPI initialization from SUNDIALS programs. 13902/head
authorDavid Wells <drwells@email.unc.edu>
Fri, 3 Jun 2022 20:20:45 +0000 (16:20 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sun, 5 Jun 2022 19:35:35 +0000 (15:35 -0400)
21 files changed:
examples/step-77/step-77.cc
tests/sundials/arkode_01.cc
tests/sundials/arkode_02.cc
tests/sundials/arkode_03.cc
tests/sundials/arkode_04.cc
tests/sundials/arkode_05.cc
tests/sundials/arkode_06.cc
tests/sundials/arkode_07.cc
tests/sundials/arkode_08.cc
tests/sundials/arkode_repeated_solve.cc
tests/sundials/ida_01.cc
tests/sundials/ida_02.cc
tests/sundials/kinsol_01.cc
tests/sundials/kinsol_02.cc
tests/sundials/kinsol_03.cc
tests/sundials/kinsol_03_new_interface.cc
tests/sundials/kinsol_04.cc
tests/sundials/kinsol_04_new_interface.cc
tests/sundials/kinsol_05.cc
tests/sundials/kinsol_05_new_interface.cc
tests/sundials/step-77.cc

index 38c5559a7394b48f8ab1e6cd384db8e7d6a1674c..3f8a5bc3797129a7cbf9a9c65b25ff5fa19ef89b 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <deal.II/base/quadrature_lib.h>
 #include <deal.II/base/function.h>
-#include <deal.II/base/mpi.h>
 #include <deal.II/base/timer.h>
 #include <deal.II/base/utilities.h>
 
@@ -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();
index b5c66a44bf14c7c2e5462f24be59a28a168c3801..e559e97ea1976f9d03b6d47c79df0c8d94d22a0b 100644 (file)
  * 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<double>;
 
   ParameterHandler                             prm;
index bd42dc9662153036bde7715b355eddb85f1cd10d..3059f38e07a656176edb64341f0e2f03f03775d1 100644 (file)
  * 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<double>;
 
   ParameterHandler                             prm;
index 941d0c2ef26f3342d917f9adddc44be81c6a5f42..9fbdccae8a4a972e523f627078ae0f4984c24ad0 100644 (file)
  * 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<double>;
 
   ParameterHandler                             prm;
index 5d3f2ad19fa2446bfd911a1065ba03e5fddd5286..d215d983fb4b22fdd6baf1edbbdda34f5d4a021b 100644 (file)
  * 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<double>;
 
   ParameterHandler                             prm;
index 72599be910fbc8df76f99cb149c701ed7662123c..526eb7fc22b26d683417155ca822598003449c69 100644 (file)
  * 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<double>;
 
   ParameterHandler                             prm;
index 1175070796c0545bf4f9e186f47dda86f1d37a0e..ba1a619afca6602b68da9337ca9414464ab0283f 100644 (file)
  * 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<double>;
 
   ParameterHandler                             prm;
index f0ae77f5d8145834c6ada34a1e081efce2a9017e..57779f7bab58c16d6e66984a4ba49a8e43df0854 100644 (file)
  * 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<double>;
 
   ParameterHandler                             prm;
index 3dfa856ef301808999eac9e0176c9f8959222779..5fb8af7db5cfa19d8dd910c76056d9f059988407 100644 (file)
  * 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<double>;
 
   ParameterHandler                             prm;
index d60a5bf235e345d52cc5d9e12b5b7249f9c1e5a5..e63f78304637477344b8e699a1605d7de6c5c6b1 100644 (file)
@@ -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<double> y(2);
index 7fa93d3e43c9f2371185859af4d71559512a4159..d83ae344e93f2ef4bc622e67c7dfcf02766d2cf9 100644 (file)
@@ -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);
 
index ea94760cdf51598a4791ba1eee736a5e16bcdb3a..e6c835967010df78fffde7aee76e716326547a26 100644 (file)
@@ -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);
 
index 028491fcea883775712a76f69917d9018eccb30e..9224bdf42332fd7a118210e6cf31a015bee05292 100644 (file)
  * 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<double>;
 
   SUNDIALS::KINSOL<VectorType>::AdditionalData data;
index dc569178592454c270dd0026632f6ba24a6aeb7a..5c8574a767c69c1d3534d5b9e58335540d83c477 100644 (file)
 // 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<double>;
 
   // Size of the problem
index 8e5c763ec2d2f26fe31a542e2ce65926ebb605af..e90968e733aae1b4b6ec512d0f37a23d37c1ba82 100644 (file)
 // 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<double>;
 
   SUNDIALS::KINSOL<VectorType>::AdditionalData data;
index bd36f20ee4943b61e86d699d23985246520c51be..11ab7f3c502ab29168fa5ee88763741bd1a390d3 100644 (file)
 // 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<double>;
 
   SUNDIALS::KINSOL<VectorType>::AdditionalData data;
index 4b28a7ea9e939109a3087053f810a45f231461d9..a499ad1afc9f27d30221a39826a7922a2ee09776 100644 (file)
 // 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<double>;
 
   SUNDIALS::KINSOL<VectorType>::AdditionalData data;
index 825a5eff484156a424c2c3cb60545cc2ee7c1bdb..f4435d791180b33234097f77c84c44d1e2d59b92 100644 (file)
 // 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<double>;
 
   SUNDIALS::KINSOL<VectorType>::AdditionalData data;
index 08ca0854a8637c8e1562da84bbe218f7cd892e39..9e8f2046e5da7e218269937bc268c7edf03aff61 100644 (file)
 // 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<double>;
 
   SUNDIALS::KINSOL<VectorType>::AdditionalData data;
index d0e9b8edf9707fa6c53463bc791de1d9adeedef1..09d40c03c76abaa50980985b1e2ed4aea2dd65d0 100644 (file)
 // 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<double>;
 
   SUNDIALS::KINSOL<VectorType>::AdditionalData data;
index 0fbf7b130521ddc34ad926e8edd33ff13c293c74..32444acc3d69362281074c13e4de46edcac8b484 100644 (file)
@@ -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();

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.