[cig-commits] r19923 - short/3D/PyLith/benchmarks/trunk/static/performance/solvertest
brad at geodynamics.org
brad at geodynamics.org
Wed Apr 4 16:38:10 PDT 2012
Author: brad
Date: 2012-04-04 16:38:10 -0700 (Wed, 04 Apr 2012)
New Revision: 19923
Modified:
short/3D/PyLith/benchmarks/trunk/static/performance/solvertest/plot_scaling.py
Log:
Added iterations.
Modified: short/3D/PyLith/benchmarks/trunk/static/performance/solvertest/plot_scaling.py
===================================================================
--- short/3D/PyLith/benchmarks/trunk/static/performance/solvertest/plot_scaling.py 2012-04-04 22:26:37 UTC (rev 19922)
+++ short/3D/PyLith/benchmarks/trunk/static/performance/solvertest/plot_scaling.py 2012-04-04 23:38:10 UTC (rev 19923)
@@ -18,8 +18,10 @@
sys.path.append("../../../figures")
import matplotlibext
-nprocs = [1,2,4,8,16,32]
-events = ["Solve",
+header = 0.25
+
+nprocs = [1,2,4,8,16,32,64]
+stages = ["Solve",
"Reform Jacobian",
"Reform Residual",
]
@@ -43,39 +45,48 @@
data = {}
for c in cells:
data[c] = {}
- for e in events:
- data[c][e] = numpy.zeros(len(nprocs), dtype=numpy.float32)
+ for s in stages:
+ data[c][s] = numpy.zeros(len(nprocs), dtype=numpy.float32)
# Get stats
+niters = {}
for c in cells:
+ niters[c] = numpy.zeros(len(nprocs), dtype=numpy.float32)
for ip in xrange(len(nprocs)):
sys.path.append("logs")
log = __import__("%s_np%03d" % (c.lower(), nprocs[ip]))
- for e in events:
+ niters[c][ip] = log.Solve.event['VecMDot'].Count[0]
+ for s in stages:
+
total = 0.0
- eattr = e.replace(' ','_')
- for sube in log.__getattribute__(eattr).event.values():
- total += numpy.mean(sube.Time)
- data[c][e][ip] = total
+ sattr = s.replace(' ','_')
+ assert(nprocs[ip] == log.__getattribute__('Nproc'))
+ data[c][s][ip] = log.__getattribute__(sattr).time / nprocs[ip]
-
figure = matplotlibext.Figure()
-figure.open(3.0, 3.25, margins=[[0.6, 0, 0.1], [0.5, 0, 0.05]], dpi=150)
-ax = figure.axes(1.35, 1, 1.35, 1)
+figure.open(3.0, 5.25, margins=[[0.6, 0, 0.1], [0.5, 0.4, 0.05]], dpi=150)
+ax = figure.axes(2.0+header, 1, 1.0+header, 1)
+
for c in cells:
- for e in events:
- ax.loglog(nprocs, data[c][e],
+ for s in stages:
+ ax.loglog(nprocs, data[c][s],
marker=symdict[c],
- color=styledict[e][0],
+ color=styledict[s][0],
linewidth=1,
- dashes=styledict[e][1])
+ dashes=styledict[s][1])
ax.hold(True)
+ if s == 'Solve':
+ ax.loglog(nprocs, data[c][s]/(niters[c]/niters[c][0]),
+ marker=symdict[c],
+ color='gray',
+ linewidth=1,
+ dashes=styledict[s][1])
ax.set_xlim((1, 128))
-ax.set_xlabel("# Processors", fontsize=10)
+#ax.set_xlabel("# Processors", fontsize=10)
-ax.set_ylim((0.01, 500))
+ax.set_ylim((0.01, 200))
ax.set_ylabel("Time (s)", fontsize=10)
import matplotlib.lines as lines
@@ -89,14 +100,30 @@
loc='lower left', bbox_to_anchor=(0,1.05), borderaxespad=0)
proxies = []
-for e in events:
+for s in stages:
proxies.append(lines.Line2D((0,0),(1,1),
marker=None,
- color=styledict[e][0],
- dashes=styledict[e][1]))
-ax.legend(proxies, events,
+ color=styledict[s][0],
+ dashes=styledict[s][1]))
+ax.legend(proxies, stages,
loc='lower right', bbox_to_anchor=(1,1.05), borderaxespad=0)
ax.add_artist(l1)
+ax = figure.axes(2.0+header, 1, 2.0+header, 1)
+
+for c in cells:
+ ax.semilogx(nprocs, niters[c],
+ marker=symdict[c],
+ color='red',
+ linewidth=1)
+ ax.hold(True)
+
+ax.set_xlim((1, 128))
+ax.set_xlabel("# Processors", fontsize=10)
+
+ax.set_ylim((0, 150))
+ax.set_ylabel("# Iterations", fontsize=10)
+
+
pyplot.show()
pyplot.savefig('scaling.pdf')
More information about the CIG-COMMITS
mailing list