[cig-commits] r11672 - short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs

brad at geodynamics.org brad at geodynamics.org
Mon Mar 31 12:18:36 PDT 2008


Author: brad
Date: 2008-03-31 12:18:35 -0700 (Mon, 31 Mar 2008)
New Revision: 11672

Added:
   short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/parselogs.py
   short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_convergence.py
   short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py
   short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/runstats.py
Modified:
   short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_summary.py
Log:
Updated for more plots.

Added: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/parselogs.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/parselogs.py	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/parselogs.py	2008-03-31 19:18:35 UTC (rev 11672)
@@ -0,0 +1,40 @@
+files = ["run_tet4_0500m_np1.log",
+         "run_tet4_0500m_np2.log",
+         "run_tet4_0500m_np4.log",
+         "run_tet4_0500m_np8.log",
+         "run_tet4_0500m_np16.log",
+         "run_hex8_0500m_np1.log",
+         "run_hex8_0500m_np2.log",
+         "run_hex8_0500m_np4.log",
+         "run_hex8_0500m_np8.log",
+         "run_hex8_0500m_np16.log",
+         ]
+
+stats = []
+for filename in files:
+    fin = open("../logs/2008mar/%s" % filename, "r")
+    lines = fin.readlines()
+
+    total = 0.0
+    distribute = 0.0
+
+    indexBegin = 29
+    indexEnd = 39
+    for line in lines:
+        record = "PyLith main"
+        if line[0:len(record)] == record:
+            total = float(line[indexBegin:indexEnd])
+            print float(line[indexBegin:indexEnd])
+
+        record = "Dist"
+        if line[0:len(record)] == record:
+            fields = line.split()
+            distribute += float(line[indexBegin:indexEnd])
+            print float(line[indexBegin:indexEnd])
+
+    stats.append({'filename': filename,
+                  'total': total,
+                  'distribute': distribute})
+
+for s in stats:
+    print s

Added: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_convergence.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_convergence.py	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_convergence.py	2008-03-31 19:18:35 UTC (rev 11672)
@@ -0,0 +1,116 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+import pylab
+
+from runstats import data
+
+class PlotSummary(object):
+
+    def __init__(self):
+        return
+
+    def main(self):
+
+        self._setup()
+
+        iplot = 1
+        pylab.subplot(self.nrows, self.ncols, iplot)
+        offset = 0
+        handles = []
+        for shape in self.shapes:
+            format = shape + " " + "%dm"
+            keys = [format % res for res in self.resolutions]
+            err = [data[key]['error'] for key in keys]
+            h = pylab.loglog(self.resolutions, err,
+                             color=self.colorShapes[shape],
+                             marker='+')
+            handles.append(h)
+            offset += 1
+            pylab.title("Global Error versus Discretization Size",
+                        fontsize=self.titleFontSize)
+            pylab.xlabel("Discretization Size (m)",
+                         fontsize=self.labelFontSize)
+            pylab.ylabel("Global Error (m)",
+                         fontsize=self.labelFontSize)
+            pylab.xticks(fontsize=self.labelFontSize)
+            pylab.yticks(fontsize=self.labelFontSize)
+            pylab.xlim(1.0e+2, 2.0e+3)
+            pylab.ylim(2.0e-5, 2.0e-3)
+            iplot += 1
+
+        pylab.legend((handles[0][0], handles[1][0]),
+                     self.shapes,
+                     shadow=True,
+                     loc='upper left')
+
+        pylab.show()
+        pylab.savefig('benchmark_convergence')
+        return
+
+    def _setup(self):
+        figWidth = 5.5
+        figHeight = 5.0
+        colors = {'fg': (0,0,0),
+                  'bg': (1,1,1),
+                  'dkgray': 0.25,
+                  'mdgray': 0.5,
+                  'ltgray': 0.75,
+                  'dkslate': (0.18, 0.21, 0.28),
+                  'slate': (0.45, 0.50, 0.68),
+                  'ltorange': (1.0, 0.74, 0.41),
+                  'orange': (0.96, 0.50, 0.0),
+                  'ltred': (1.0, 0.25, 0.25),
+                  'red': (0.79, 0.00, 0.01),
+                  'ltblue': (0.2, 0.73, 1.0),
+                  'blue': (0.12, 0.43, 0.59),
+                  'green': (0.37, 0.80, 0.05),
+                  'green': (0.23, 0.49, 0.03)}
+        from matplotlib.colors import colorConverter
+        for key in colors.keys():
+            colorConverter.colors[key] = colors[key]
+        self.titleFontSize = 18
+        self.labelFontSize = 14
+
+        self.nrows = 1
+        self.ncols = 1
+
+        self.resolutions = [1000, 500, 250]
+        self.shapes = ["Tet4", "Hex8"]
+
+        self.width = 1.0/(len(self.shapes)+1)
+        self.locs = pylab.arange(len(self.resolutions))
+        self.loc0 = self.locs - 0.5*len(self.shapes)*self.width
+
+        self.colorShapes = {'Tet4': 'orange',
+                            'Hex8': 'blue'}
+
+        pylab.figure(figsize=(figWidth, figHeight),
+                     facecolor='bg',
+                     dpi=90)
+        pylab.subplots_adjust(left=0.14,
+                              right=0.96,
+                              bottom=0.10,
+                              top=0.91,
+                              wspace=0.22,
+                              hspace=0.35)
+        return
+
+
+# ----------------------------------------------------------------------
+if __name__ == "__main__":
+  app = PlotSummary()
+  app.main()
+
+
+# End of file
+


Property changes on: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_convergence.py
___________________________________________________________________
Name: svn:executable
   + *

Added: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py	2008-03-31 19:18:35 UTC (rev 11672)
@@ -0,0 +1,123 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+import pylab
+
+from runstats import dataScaling as data
+
+class PlotSummary(object):
+
+    def __init__(self):
+        return
+
+    def main(self):
+
+        self._setup()
+
+        iplot = 1
+        pylab.subplot(self.nrows, self.ncols, iplot)
+        handles = []
+        labels = []
+        for shape in self.shapes:
+            nprocs = []
+            total = []
+            compute = []
+            for sim in data[shape]:
+                nprocs.append(sim['nprocs'])
+                total.append(sim['total'])
+                compute.append(sim['total']-sim['distribute'])
+            h = pylab.loglog(nprocs, total,
+                           color=self.colorShapes[shape],
+                           marker='+')
+            handles.append(h)
+            h = pylab.loglog(nprocs, compute,
+                           color=self.colorShapes[shape],
+                           linestyle="--",
+                           marker='+')
+            handles.append(h)
+            pylab.title("Runtime versus Number of Processors",
+                        fontsize=self.titleFontSize)
+            pylab.xlabel("Number of Processors",
+                         fontsize=self.labelFontSize)
+            pylab.ylabel("Runtime (s)",
+                         fontsize=self.labelFontSize)
+            pylab.xticks(fontsize=self.labelFontSize)
+            pylab.yticks(fontsize=self.labelFontSize)
+            pylab.xlim(0.5, 32)
+            pylab.ylim(1.0e+2, 2.0e+3)
+            iplot += 1
+            labels += ["%s total" % shape, "%s compute" % shape]
+
+        pylab.legend((handles[0][0], handles[1][0],
+                      handles[2][0], handles[3][0]),
+                     labels,
+                     shadow=True,
+                     loc='upper right')
+
+        pylab.show()
+        pylab.savefig('benchmark_scaling')
+        return
+
+    def _setup(self):
+        figWidth = 5.5
+        figHeight = 5.0
+        colors = {'fg': (0,0,0),
+                  'bg': (1,1,1),
+                  'dkgray': 0.25,
+                  'mdgray': 0.5,
+                  'ltgray': 0.75,
+                  'dkslate': (0.18, 0.21, 0.28),
+                  'slate': (0.45, 0.50, 0.68),
+                  'ltorange': (1.0, 0.74, 0.41),
+                  'orange': (0.96, 0.50, 0.0),
+                  'ltred': (1.0, 0.25, 0.25),
+                  'red': (0.79, 0.00, 0.01),
+                  'ltblue': (0.2, 0.73, 1.0),
+                  'blue': (0.12, 0.43, 0.59),
+                  'green': (0.37, 0.80, 0.05),
+                  'green': (0.23, 0.49, 0.03)}
+        from matplotlib.colors import colorConverter
+        for key in colors.keys():
+            colorConverter.colors[key] = colors[key]
+        self.titleFontSize = 18
+        self.labelFontSize = 14
+
+        self.nrows = 1
+        self.ncols = 1
+
+        self.shapes = ["Tet4", "Hex8"]
+
+        self.width = 1.0/(len(self.shapes)+1)
+
+        self.colorShapes = {'Tet4': 'orange',
+                            'Hex8': 'blue'}
+
+        pylab.figure(figsize=(figWidth, figHeight),
+                     facecolor='bg',
+                     dpi=90)
+        pylab.subplots_adjust(left=0.14,
+                              right=0.96,
+                              bottom=0.10,
+                              top=0.91,
+                              wspace=0.22,
+                              hspace=0.35)
+        return
+
+
+# ----------------------------------------------------------------------
+if __name__ == "__main__":
+  app = PlotSummary()
+  app.main()
+
+
+# End of file
+


Property changes on: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py
___________________________________________________________________
Name: svn:executable
   + *

Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_summary.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_summary.py	2008-03-31 19:15:24 UTC (rev 11671)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_summary.py	2008-03-31 19:18:35 UTC (rev 11672)
@@ -12,65 +12,8 @@
 
 import pylab
 
-# Hydra (2.2 GHz Opteron)
-data = {
-    "Tet4 1000m": {
-        'ncells': 79756,
-        'nvertices': 15625,
-        'nflops': 1.01e+09,
-        'run_time': 35.8,
-        'error': 1.41e-03,
-        'niterations': 60,
-        'memory': 313},
+from runstats import data
 
-    "Hex8 1000m": {
-        'ncells': 13824,
-        'nvertices': 15625,
-        'nflops': 1.95e+09,
-        'run_time': 15.9,
-        'error': 6.58e-04,
-        'niterations': 37,
-        'memory': 185},
-
-    "Tet4 500m": {
-        'ncells': 661929,
-        'nvertices': 117649,
-        'nflops': 1.28e+10,
-        'run_time': 377.0,
-        'error': 4.79e-04,
-        'niterations': 106,
-        'memory': 2400.0},
-
-    "Hex8 500m": {
-        'ncells': 110592,
-        'nvertices': 117649,
-        'nflops': 2.12e+10,
-        'run_time': 154.0,
-        'error': 1.94e-04,
-        'niterations': 68,
-        'memory': 2100.0},
-
-
-    "Tet4 250m": {
-        'ncells': 5244768,
-        'nvertices': 912673,
-        'nflops': 0.0,
-        'run_time': 0.0,
-        'error': 1.30e-04,
-        'niterations': 0,
-        'memory': 0.0},
-
-    "Hex8 250m" : {
-        'ncells': 884736,
-        'nvertices': 912673,
-        'nflops': 0.0,
-        'run_time': 0.0,
-        'error': 7.70e-05,
-        'niterations': 0,
-        'memory': 0.0}
-    }
-
-
 class PlotSummary(object):
 
     def __init__(self):
@@ -139,7 +82,7 @@
                      loc='center')
 
         pylab.show()
-        #pylab.savefig('benchmark_summary')
+        pylab.savefig('benchmark_summary')
         return
 
     def _setup(self):

Added: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/runstats.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/runstats.py	                        (rev 0)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/runstats.py	2008-03-31 19:18:35 UTC (rev 11672)
@@ -0,0 +1,107 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+#                           Brad T. Aagaard
+#                        U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+# Hydra (2.2 GHz Opteron)
+data = {
+    "Tet4 1000m": {
+        'ncells': 79756,
+        'nvertices': 15625,
+        'nflops': 9.911e+08,
+        'run_time': 42.0,
+        'error': 1.41e-03,
+        'niterations': 59,
+        'memory': 340},
+
+    "Hex8 1000m": {
+        'ncells': 13824,
+        'nvertices': 15625,
+        'nflops': 1.97e+09,
+        'run_time': 18.9,
+        'error': 6.58e-04,
+        'niterations': 38,
+        'memory': 293},
+
+    "Tet4 500m": {
+        'ncells': 661929,
+        'nvertices': 117649,
+        'nflops': 1.293e+10,
+        'run_time': 380.6,
+        'error': 4.79e-04,
+        'niterations': 107,
+        'memory': 2514.6},
+
+    "Hex8 500m": {
+        'ncells': 110592,
+        'nvertices': 117649,
+        'nflops': 2.16e+10,
+        'run_time': 165.5,
+        'error': 1.94e-04,
+        'niterations': 70,
+        'memory': 2205.9},
+
+
+    "Tet4 250m": {
+        'ncells': 5244768,
+        'nvertices': 912673,
+        'nflops': 0.0,
+        'run_time': 0.0,
+        'error': 1.30e-04,
+        'niterations': 0,
+        'memory': 0.0},
+
+    "Hex8 250m" : {
+        'ncells': 884736,
+        'nvertices': 912673,
+        'nflops': 0.0,
+        'run_time': 0.0,
+        'error': 7.70e-05,
+        'niterations': 0,
+        'memory': 0.0}
+    }
+
+# Hydra (2.2 GHz Opteron)
+dataScaling = {
+    "Tet4":
+    [{'nprocs': 1,
+      'total': 380.6,
+      'distribute': 0.0},
+     {'nprocs': 2,
+      'total': 613.0,
+      'distribute': 339.4},
+     {'nprocs': 4,
+      'total': 523.4,
+      'distribute': 316.3},
+     {'nprocs': 8,
+      'total': 508.4,
+      'distribute': 317.5},
+     {'nprocs': 16,
+      'total': 487.8,
+      'distribute': 310.0},
+     ],
+    "Hex8":
+     [{'nprocs': 1,
+       'total': 165.4,
+       'distribute': 0.0},
+      {'nprocs': 2,
+       'total': 206.4,
+       'distribute': 50.4},
+      {'nprocs': 4,
+       'total': 181.22,
+       'distribute': 49.8},
+      {'nprocs': 8,
+       'total': 181.8,
+       'distribute': 52.5},
+      {'nprocs': 16,
+       'total': 188.0,
+       'distribute': 52.2},
+      ]
+    }



More information about the cig-commits mailing list