]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce function to delete all unused vectors in GrowingVectorMemory
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 7 Mar 2017 17:56:59 +0000 (18:56 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 8 Mar 2017 09:39:10 +0000 (10:39 +0100)
include/deal.II/lac/vector_memory.h
source/lac/CMakeLists.txt
source/lac/vector_memory.cc
source/lac/vector_memory_release.inst.in [new file with mode: 0644]

index 72fd8edf1605490763549fc9e5a1d0d9fdd98b6e..2f755617096a27cb41792e4d779d6fdf0a3ee6e5 100644 (file)
@@ -348,6 +348,16 @@ private:
   static Threads::Mutex mutex;
 };
 
+
+
+namespace internal
+{
+  namespace GrowingVectorMemory
+  {
+    void release_all_unused_memory();
+  }
+}
+
 /*@}*/
 
 #ifndef DOXYGEN
index 6f9a93f9d1b0bd74a19a6b611026b24fab341880..5d6de52c71ad931c073cdf2343589ac995abd2eb 100644 (file)
@@ -74,6 +74,7 @@ SET(_inst
   sparse_matrix.inst.in
   vector.inst.in
   vector_memory.inst.in
+  vector_memory_release.inst.in
   vector_view.inst.in
   )
 
index 76aeb5980f8170872a3e95347645e65e7b7271c5..ef86a5e2318ceba3ce6f72d8543ebda882b3648c 100644 (file)
@@ -32,4 +32,15 @@ DEAL_II_NAMESPACE_OPEN
 
 #include "vector_memory.inst"
 
+namespace internal
+{
+  namespace GrowingVectorMemory
+  {
+    void release_all_unused_memory()
+    {
+#include "vector_memory_release.inst"
+    }
+  }
+}
+
 DEAL_II_NAMESPACE_CLOSE
diff --git a/source/lac/vector_memory_release.inst.in b/source/lac/vector_memory_release.inst.in
new file mode 100644 (file)
index 0000000..17564ed
--- /dev/null
@@ -0,0 +1,27 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 1999 - 2016 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+for (VECTOR : SERIAL_VECTORS)
+{
+    dealii::GrowingVectorMemory<dealii::VECTOR>::release_unused_memory();
+}
+
+for (SCALAR : COMPLEX_SCALARS)
+{
+    dealii::GrowingVectorMemory<dealii::Vector<SCALAR> >::release_unused_memory();
+    dealii::GrowingVectorMemory<dealii::BlockVector<SCALAR> >::release_unused_memory();
+}

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.