]> https://gitweb.dealii.org/ - dealii.git/commitdiff
destroy GrowingVectorMemory with PETSc objects at the end
authorTimo Heister <timo.heister@gmail.com>
Sat, 3 Nov 2012 03:45:28 +0000 (03:45 +0000)
committerTimo Heister <timo.heister@gmail.com>
Sat, 3 Nov 2012 03:45:28 +0000 (03:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@27330 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/mpi.cc

index c72910dc308945ed0686ff42fed82fcd4ecede6a..bf09f0629933f5b573fbfd4bfb3b1684f228fba6 100644 (file)
 #ifdef DEAL_II_USE_PETSC
 #  ifdef DEAL_II_COMPILER_SUPPORTS_MPI
 #    include <petscsys.h>
+#include <deal.II/lac/petsc_block_vector.h>
+#include <deal.II/lac/petsc_parallel_block_vector.h>
+#include <deal.II/lac/petsc_vector.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
 #  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<PETScWrappers::MPI::Vector>
+        ::release_unused_memory ();
+      GrowingVectorMemory<PETScWrappers::MPI::BlockVector>
+        ::release_unused_memory ();
+      GrowingVectorMemory<PETScWrappers::Vector>
+        ::release_unused_memory ();
+      GrowingVectorMemory<PETScWrappers::BlockVector>
+        ::release_unused_memory ();
+
+                                      // now end PETSc.
       PetscFinalize();
 #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.