[cig-commits] r13316 - short/3D/PyLith/trunk/playpen/memcheck

knepley at geodynamics.org knepley at geodynamics.org
Sat Nov 15 11:29:37 PST 2008


Author: knepley
Date: 2008-11-15 11:29:37 -0800 (Sat, 15 Nov 2008)
New Revision: 13316

Modified:
   short/3D/PyLith/trunk/playpen/memcheck/memory_usage.py
Log:
Updates to memory script


Modified: short/3D/PyLith/trunk/playpen/memcheck/memory_usage.py
===================================================================
--- short/3D/PyLith/trunk/playpen/memcheck/memory_usage.py	2008-11-15 01:21:45 UTC (rev 13315)
+++ short/3D/PyLith/trunk/playpen/memcheck/memory_usage.py	2008-11-15 19:29:37 UTC (rev 13316)
@@ -121,6 +121,7 @@
     """
     memory = {'mesh': 0,
               'stratification': 0,
+              'coordinates': 0,
               'materials': 0}
     ncells = self.ncells
     nvertices = self.nvertices
@@ -137,6 +138,10 @@
     nbytes = 2 * sizeArrow * (nvertices + ncells)
     memory['stratification'] = nbytes
 
+    # coordinates
+    nbytes = dimension * nvertices
+    memory['coordinates'] = nbytes
+
     # materials
     nbytes = 2 * sizeArrow * ncells
     memory['materials'] = nbytes
@@ -363,13 +368,16 @@
     print "MEMORY USAGE"
     print "  Finite-element mesh"
     memory = self.memory['mesh']
-    print "    Mesh: %d bytes (%.3f MB)" % \
+    print "    Mesh:           %d bytes (%.3f MB)" % \
           (memory['mesh'],
            memory['mesh'] / megabyte)
     print "    Stratification: %d bytes (%.3f MB)" % \
           (memory['stratification'],
            memory['stratification'] / megabyte)
-    print "    Materials: %d bytes (%.3f MB)" % \
+    print "    Coordinates:      %d bytes (%.3f MB)" % \
+          (memory['coordinates'],
+           memory['coordinates'] / megabyte)
+    print "    Materials:      %d bytes (%.3f MB)" % \
           (memory['materials'],
            memory['materials'] / megabyte)
 
@@ -382,7 +390,7 @@
     for (label, nbytes) in self.memory['materials'].items():
       print "    %s: %d bytes (%.3f MB)" % \
             (label, nbytes, nbytes / megabyte)
-    print "  TOTAL: %d bytes (%.3f MB)" % \
+    print "  TOTAL:           %d bytes (%.3f MB)" % \
           (self.memory['total'], self.memory['total'] / megabyte)
 
     return



More information about the CIG-COMMITS mailing list