[cig-commits] r13240 - short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs
brad at geodynamics.org
brad at geodynamics.org
Mon Nov 3 18:10:49 PST 2008
Author: brad
Date: 2008-11-03 18:10:49 -0800 (Mon, 03 Nov 2008)
New Revision: 13240
Modified:
short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/parselogs.py
short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py
short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/runstats.py
Log:
Updated scaling stuff for using stages in logging.
Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/parselogs.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/parselogs.py 2008-11-04 02:10:39 UTC (rev 13239)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/parselogs.py 2008-11-04 02:10:49 UTC (rev 13240)
@@ -12,27 +12,43 @@
stats = []
for filename in files:
- fin = open("../logs/2008mar/%s" % filename, "r")
+ fin = open("../logs/2008nov03/%s" % filename, "r")
lines = fin.readlines()
total = 0.0
- distribute = 0.0
+ compute = 0.0
- indexBegin = 29
- indexEnd = 39
+ offset = 3
for line in lines:
+ # Events
+ indexBegin = 29
+ indexEnd = 39
record = "PyLith main"
- if line[0:len(record)] == record:
- total = float(line[indexBegin:indexEnd])
+ if line[offset:offset+len(record)] == record:
+ total = float(line[offset+indexBegin:offset+indexEnd])
- record = "Dist"
- if line[0:len(record)] == record:
+ # Stages
+ indexBegin = 21
+ indexEnd = 31
+
+ record = " 5: Reform Jacobian"
+ if line[offset:offset+len(record)] == record:
fields = line.split()
- distribute += float(line[indexBegin:indexEnd])
+ compute += float(line[offset+indexBegin:offset+indexEnd])
+ record = " 6: Reform Residual"
+ if line[offset:offset+len(record)] == record:
+ fields = line.split()
+ compute += float(line[offset+indexBegin:offset+indexEnd])
+
+ record = " 7: Solve"
+ if line[offset:offset+len(record)] == record:
+ fields = line.split()
+ compute += float(line[offset+indexBegin:offset+indexEnd])
+
stats.append({'filename': filename,
'total': total,
- 'distribute': distribute})
+ 'compute': compute})
for s in stats:
print s
Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py 2008-11-04 02:10:39 UTC (rev 13239)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/plot_scaling.py 2008-11-04 02:10:49 UTC (rev 13240)
@@ -10,112 +10,97 @@
# ======================================================================
#
+plotSize = "manual"
+color = "lightbg"
+fileSuffix = "eps"
+
+# ======================================================================
import pylab
+from mypylab.Figure import Figure
-from runstats import dataScaling as data
+from runstats import dataScaling_v1_3 as data
-class PlotSummary(object):
+# ----------------------------------------------------------------------
+class PlotScaling(Figure):
- def __init__(self):
- return
+ def __init__(self):
+ if plotSize == "poster":
+ fontsize = 21
+ elif plotSize == "presentation":
+ fontsize = 14
+ elif plotSize == "manual":
+ fontsize = 10
+ else:
+ raise ValueError("Unknown plotSize '%s'." % plotSize)
+ Figure.__init__(self, color=color, fontsize=fontsize)
+ return
- def main(self):
- self._setup()
+ def main(self):
- 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]
+ if plotSize == "poster":
+ self.width = 6.5
+ self.height = 5.75
+ margins = [[0.90, 0, 0.05], [0.70, 0, 0.12]]
+ elif plotSize == "presentation":
+ self.width = 4.0
+ self.height = 5.0
+ margins = [[0.7, 0, 0.05], [0.5, 0, 0.1]]
+ elif plotSize == "manual":
+ self.width = 5.5
+ self.height = 5.0
+ margins = [[0.6, 0, 0.05], [0.5, 0, 0.25]]
+ else:
+ raise ValueError("Unknown plotSize '%s'." % plotSize)
- pylab.legend((handles[0][0], handles[1][0],
- handles[2][0], handles[3][0]),
- labels,
- shadow=True,
- loc='upper right')
+ # Create figure
+ self.open(self.width, self.height, margins=margins)
+ self.axes(1, 1, 1, 1)
- pylab.show()
- pylab.savefig('benchmark_scaling')
- return
+ shapes = ["Tet4", "Hex8"]
+ colorShapes = {'Tet4': 'orange',
+ 'Hex8': 'blue'}
- 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
+ handles = []
+ labels = []
+ for shape in shapes:
+ nprocs = []
+ total = []
+ compute = []
+ for sim in data[shape]:
+ nprocs.append(sim['nprocs'])
+ total.append(sim['total'])
+ compute.append(sim['compute'])
+ h = pylab.loglog(nprocs, total,
+ color=colorShapes[shape],
+ marker='+')
+ handles.append(h)
+ h = pylab.loglog(nprocs, compute,
+ color=colorShapes[shape],
+ linestyle="--",
+ marker='+')
+ handles.append(h)
+ pylab.title("Runtime versus Number of Processors")
+ pylab.xlabel("Number of Processors")
+ pylab.ylabel("Runtime (s)")
+ pylab.xlim(0.5, 32)
+ pylab.ylim(5.0e+0, 8.0e+2)
+ labels += ["%s total" % shape, "%s compute" % shape]
- self.nrows = 1
- self.ncols = 1
+ pylab.legend((handles[0][0], handles[1][0],
+ handles[2][0], handles[3][0]),
+ labels,
+ shadow=True,
+ loc='lower left')
- self.shapes = ["Tet4", "Hex8"]
+ pylab.show()
+ pylab.savefig("benchmark_scaling.%s" % fileSuffix)
+ return
- 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 = PlotScaling()
app.main()
Modified: short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/runstats.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/runstats.py 2008-11-04 02:10:39 UTC (rev 13239)
+++ short/3D/PyLith/benchmarks/trunk/quasistatic/strikeslipnog/figs/runstats.py 2008-11-04 02:10:49 UTC (rev 13240)
@@ -110,24 +110,24 @@
}
# ----------------------------------------------------------------------
-# Version 1.3
+# Version 1.3.1
# ----------------------------------------------------------------------
# Hydra (2.2 GHz Opteron)
data_v1_3 = {
"Tet4 1000m": {
'ncells': 79756,
'nvertices': 15625,
- 'nflops': 9.957e+08,
- 'run_time': 31.2,
+ 'nflops': 9.958e+08,
+ 'run_time': 26.51,
'error': 1.41e-03,
'niterations': 59,
- 'memory': 235},
+ 'memory': 234.1},
"Hex8 1000m": {
'ncells': 13824,
'nvertices': 15625,
- 'nflops': 1.976e+09,
- 'run_time': 14.0,
+ 'nflops': 1.977e+09,
+ 'run_time': 13.45,
'error': 6.58e-04,
'niterations': 38,
'memory': 229},
@@ -136,7 +136,7 @@
'ncells': 661929,
'nvertices': 117649,
'nflops': 1.297e+10,
- 'run_time': 271.0,
+ 'run_time': 237.4,
'error': 4.79e-04,
'niterations': 107,
'memory': 1709.0},
@@ -145,17 +145,17 @@
'ncells': 110592,
'nvertices': 117649,
'nflops': 2.165e+10,
- 'run_time': 126.5,
+ 'run_time': 120.7,
'error': 1.94e-04,
'niterations': 70,
- 'memory': 1710.8},
+ 'memory': 1710.6},
"Tet4 250m": {
'ncells': 5244768,
'nvertices': 912673,
'nflops': 2.093e+11,
- 'run_time': 2.653e+03,
+ 'run_time': 2.355e+03,
'error': 1.30e-04,
'niterations': 228,
'memory': 12000.0},
@@ -164,7 +164,7 @@
'ncells': 884736,
'nvertices': 912673,
'nflops': 2.521e+11,
- 'run_time': 1.330e+03,
+ 'run_time': 1.268e+03,
'error': 7.70e-05,
'niterations': 134,
'memory': 12000.0}
@@ -173,37 +173,18 @@
# Hydra (2.2 GHz Opteron)
dataScaling_v1_3 = {
"Tet4":
- [{'nprocs': 1,
- 'total': 271.0,
- 'distribute': 0.0},
- {'nprocs': 2,
- 'total': 456.5,
- 'distribute': 181.1},
- {'nprocs': 4,
- 'total': 0,
- 'distribute': 0},
- {'nprocs': 8,
- 'total': 0,
- 'distribute': 0},
- {'nprocs': 16,
- 'total': 0,
- 'distribute': 0},
+ [{'nprocs': 1, 'total': 237.2, 'compute': 75.88},
+ {'nprocs': 2, 'total': 398.2, 'compute': 56.14},
+ {'nprocs': 4, 'total': 307.3, 'compute': 39.93},
+ {'nprocs': 8, 'total': 252.9, 'compute': 16.50},
+ {'nprocs': 16, 'total': 234.8, 'compute': 10.70},
],
+
"Hex8":
- [{'nprocs': 1,
- 'total': 126.5,
- 'distribute': 0.0},
- {'nprocs': 2,
- 'total': 189.0,
- 'distribute': 33.3},
- {'nprocs': 4,
- 'total': 0,
- 'distribute': 0},
- {'nprocs': 8,
- 'total': 0,
- 'distribute': 0},
- {'nprocs': 16,
- 'total': 0,
- 'distribute': 0},
+ [{'nprocs': 1, 'total': 117.5, 'compute': 56.08},
+ {'nprocs': 2, 'total': 174.5, 'compute': 46.63},
+ {'nprocs': 4, 'total': 111.9, 'compute': 29.41},
+ {'nprocs': 8, 'total': 86.3, 'compute': 16.01},
+ {'nprocs': 16, 'total': 78.7, 'compute': 10.46},
]
}
More information about the CIG-COMMITS
mailing list