]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Initialize MPI with step-77.
authorDavid Wells <drwells@email.unc.edu>
Fri, 3 Jun 2022 15:28:16 +0000 (11:28 -0400)
committerDavid Wells <drwells@email.unc.edu>
Fri, 3 Jun 2022 17:09:26 +0000 (13:09 -0400)
SUNDIALS duplicates communicators even in serial.

examples/step-77/step-77.cc

index 3f8a5bc3797129a7cbf9a9c65b25ff5fa19ef89b..38c5559a7394b48f8ab1e6cd384db8e7d6a1674c 100644 (file)
@@ -29,6 +29,7 @@
 
 #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>
 
@@ -640,11 +641,19 @@ namespace Step77
 } // namespace Step77
 
 
-int main()
+int main(int argc, char **argv)
 {
   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();

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.