From c91e561c1e8393b042897759b7f32f6ae40c3641 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sat, 3 Nov 2012 03:45:28 +0000 Subject: [PATCH] destroy GrowingVectorMemory with PETSc objects at the end git-svn-id: https://svn.dealii.org/trunk@27330 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/base/mpi.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 -- 2.39.5