]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Give SLEPc the MPI_InitFinalize interface like what PETSc has.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 Dec 2012 13:37:15 +0000 (13:37 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 Dec 2012 13:37:15 +0000 (13:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@27753 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/mpi.cc

index 0ed894db31a1751ce50185f9633124384798f29b..15917ddfb9858a393fb928d74e85aa66a9e7c22b 100644 (file)
 #  endif
 #endif
 
+#ifdef DEAL_II_USE_SLEPC
+#  ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+#    include <slepcsys.h>
+#  endif
+#endif
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -316,7 +321,13 @@ namespace Utilities
       // if we have PETSc, we will initialize it and let it handle MPI.
       // Otherwise, we will do it.
 #ifdef DEAL_II_USE_PETSC
+#  ifdef DEAL_II_USE_SLEPC
+      // Initialise SLEPc (with PETSc):
+      SlepcInitialize(&argc, &argv, PETSC_NULL, PETSC_NULL);
+#  else
+      // or just initialise PETSc alone:
       PetscInitialize(&argc, &argv, PETSC_NULL, PETSC_NULL);
+#  endif
 #else
       int MPI_has_been_started = 0;
       MPI_Initialized(&MPI_has_been_started);
@@ -367,8 +378,13 @@ namespace Utilities
       GrowingVectorMemory<PETScWrappers::BlockVector>
       ::release_unused_memory ();
 
-      // now end PETSc.
+#  ifdef DEAL_II_USE_SLEPC
+      // and now end SLEPc (with PETSc)
+      SlepcFinalize();
+#  else
+      // or just end PETSc.
       PetscFinalize();
+#  endif
 #else
 
 

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.