From: Toby D. Young Date: Tue, 4 Dec 2012 13:37:15 +0000 (+0000) Subject: Give SLEPc the MPI_InitFinalize interface like what PETSc has. X-Git-Tag: v8.0.0~1735 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fe9ae5ff1af9863152f568e6c10f9d11d4f7fa4;p=dealii.git Give SLEPc the MPI_InitFinalize interface like what PETSc has. git-svn-id: https://svn.dealii.org/trunk@27753 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/base/mpi.cc b/deal.II/source/base/mpi.cc index 0ed894db31..15917ddfb9 100644 --- a/deal.II/source/base/mpi.cc +++ b/deal.II/source/base/mpi.cc @@ -38,6 +38,11 @@ # endif #endif +#ifdef DEAL_II_USE_SLEPC +# ifdef DEAL_II_COMPILER_SUPPORTS_MPI +# include +# 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 ::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