smplock01: Fix plot scripts

This commit is contained in:
Sebastian Huber
2016-12-07 11:21:28 +01:00
parent 28fda6279b
commit ccda60bdb6
2 changed files with 4 additions and 2 deletions

View File

@@ -36,7 +36,7 @@ def normedCoefficientOfVariation(name, i):
y = map(m, ctx.xpathEval('/SMPLock01/' + name + '[@activeWorker=' + str(i) + ']/LocalCounter'))
if len(y) == 0:
raise
return (statistics.stdev(y) / statistics.mean(y)) / math.sqrt(len(y) - 1)
return (statistics.stdev(y) / statistics.mean(y)) / math.sqrt(len(y))
try:
while True:
@@ -49,7 +49,8 @@ except:
pass
x = range(2, len(ticket) + 2)
plt.yscale('log')
plt.xticks(x)
plt.yscale('symlog', linthreshy = 1e-6)
plt.plot(x, ticket, label = 'Ticket Lock', marker = 'o')
plt.plot(x, mcs, label = 'MCS Lock', marker = 'o')
plt.plot(x, tas, label = 'TAS Lock', marker = 'o')

View File

@@ -23,6 +23,7 @@ plt.ylabel('Operation Count')
y = map(xmlNode.getContent, ctx.xpathEval('/SMPLock01/GlobalTicketLockWithLocalCounter/SumOfLocalCounter'))
x = range(1, len(y) + 1)
plt.xticks(x)
plt.plot(x, y, label = 'Ticket Lock', marker = 'o')
y = map(xmlNode.getContent, ctx.xpathEval('/SMPLock01/GlobalMCSLockWithLocalCounter/SumOfLocalCounter'))