]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Improve computation of MemoryConsumption of MGTransferBlockBase and MGTransferCompone...
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 23 May 2008 19:35:19 +0000 (19:35 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 23 May 2008 19:35:19 +0000 (19:35 +0000)
accurate computation requires memory_consumption(std::map<...>), which should be implemented for next version

git-svn-id: https://svn.dealii.org/trunk@16193 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/multigrid/multigrid.all_dimensions.cc

index 556afba18021f19e1744c8a44955d1309b132b04..92966843a22c076ee655f85b8f0d768308a30a0b 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -225,15 +225,27 @@ void MGTransferBlock<number>::restrict_and_add (
 
 
 
-//TODO:[GK] Add all those little vectors.
 unsigned int
 MGTransferComponentBase::memory_consumption () const
 {
   unsigned int result = sizeof(*this);
-  result += sizeof(unsigned int) * sizes.size();
-  for (unsigned int i=0;i<prolongation_matrices.size();++i)
-    result += prolongation_matrices[i]->memory_consumption()
-             + prolongation_sparsities[i]->memory_consumption();
+  result += MemoryConsumption::memory_consumption(selected)
+           - sizeof(selected);
+  result += MemoryConsumption::memory_consumption(target_component)
+           - sizeof(mg_target_component);
+  result += MemoryConsumption::memory_consumption(sizes)
+           - sizeof(sizes);
+  result += MemoryConsumption::memory_consumption(component_start)
+           - sizeof(component_start);
+  result += MemoryConsumption::memory_consumption(mg_component_start)
+           - sizeof(mg_component_start);
+  result += MemoryConsumption::memory_consumption(prolongation_sparsities)
+           - sizeof(prolongation_sparsities);
+  result += MemoryConsumption::memory_consumption(prolongation_matrices)
+           - sizeof(prolongation_matrices);
+//TODO:[GK] Add this.
+//   result += MemoryConsumption::memory_consumption(copy_to_and_from_indices)
+//         - sizeof(copy_to_and_from_indices);
   return result;
 }
 
@@ -244,9 +256,21 @@ MGTransferBlockBase::memory_consumption () const
 {
   unsigned int result = sizeof(*this);
   result += sizeof(unsigned int) * sizes.size();
-  for (unsigned int i=0;i<prolongation_matrices.size();++i)
-    result += prolongation_matrices[i]->memory_consumption()
-             + prolongation_sparsities[i]->memory_consumption();
+  result += MemoryConsumption::memory_consumption(selected)
+           - sizeof(selected);
+  result += MemoryConsumption::memory_consumption(mg_block)
+           - sizeof(mg_block);
+  result += MemoryConsumption::memory_consumption(block_start)
+           - sizeof(block_start);
+  result += MemoryConsumption::memory_consumption(mg_block_start)
+           - sizeof(mg_block_start);
+  result += MemoryConsumption::memory_consumption(prolongation_sparsities)
+           - sizeof(prolongation_sparsities);
+  result += MemoryConsumption::memory_consumption(prolongation_matrices)
+           - sizeof(prolongation_matrices);
+//TODO:[GK] Add this.
+//   result += MemoryConsumption::memory_consumption(copy_indices)
+//         - sizeof(copy_indices);
   return result;
 }
 

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.