]> https://gitweb.dealii.org/ - dealii.git/commitdiff
For programs that use Trilinos, we need to initialize the MPI system even if the... 412/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 9 Jan 2015 07:26:37 +0000 (01:26 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 9 Jan 2015 19:03:20 +0000 (13:03 -0600)
examples/step-43/step-43.cc

index 2d89d116276f66cb2a37271ea9eef18de3527f72..e5be5dfc583432f267f91b653f9cd06da4908290 100644 (file)
@@ -2239,8 +2239,11 @@ start_time_iteration:
 
 // @sect3{The <code>main()</code> function}
 //
-// The main function looks almost the same as in all other programs:
-int main ()
+// The main function looks almost the same as in all other programs. The need
+// to initialize the MPI subsystem for a program that uses Trilinos -- even
+// for programs that do not actually run in parallel -- is explained in
+// step-31.
+int main (int argc, char *argv[])
 {
   try
     {
@@ -2249,6 +2252,8 @@ int main ()
 
       deallog.depth_console (0);
 
+      Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv);
+
       TwoPhaseFlowProblem<2> two_phase_flow_problem(1);
       two_phase_flow_problem.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.