From: heister Date: Sat, 3 Nov 2012 03:45:28 +0000 (+0000) Subject: destroy GrowingVectorMemory with PETSc objects at the end X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb96431e72242b585cc5e95a21f7e4b2063dfa7b;p=dealii-svn.git destroy GrowingVectorMemory with PETSc objects at the end git-svn-id: https://svn.dealii.org/trunk@27330 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/base/mpi.cc b/deal.II/source/base/mpi.cc index c72910dc30..bf09f06299 100644 --- a/deal.II/source/base/mpi.cc +++ b/deal.II/source/base/mpi.cc @@ -30,6 +30,10 @@ #ifdef DEAL_II_USE_PETSC # ifdef DEAL_II_COMPILER_SUPPORTS_MPI # include +#include +#include +#include +#include # endif #endif @@ -336,7 +340,6 @@ namespace Utilities { #ifdef DEAL_II_COMPILER_SUPPORTS_MPI -# if defined(DEAL_II_USE_TRILINOS) && !defined(__APPLE__) // make memory pool release all // vectors that are no longer // used at this point. this is @@ -347,6 +350,7 @@ namespace Utilities // MPI_Finalize is called, // leading to errors // +# if defined(DEAL_II_USE_TRILINOS) && !defined(__APPLE__) // TODO: On Mac OS X, shared libs can // only depend on other libs listed // later on the command line. This @@ -363,7 +367,18 @@ namespace Utilities ::release_unused_memory (); # endif + // Same for PETSc. #ifdef DEAL_II_USE_PETSC + GrowingVectorMemory + ::release_unused_memory (); + GrowingVectorMemory + ::release_unused_memory (); + GrowingVectorMemory + ::release_unused_memory (); + GrowingVectorMemory + ::release_unused_memory (); + + // now end PETSc. PetscFinalize(); #else