Updated branch predictor results processing script.

This commit is contained in:
Ross Thompson 2023-02-22 16:11:52 -06:00
parent 1af7b8051e
commit 4a9dbe4680

View File

@ -124,8 +124,9 @@ def ProcessFile(fileName):
benchmarks.append((testName, opt, HPMClist)) benchmarks.append((testName, opt, HPMClist))
return benchmarks return benchmarks
def ComputeAverage(benchmarks): def ComputeArithmeticAverage(benchmarks):
average = {} average = {}
index = 0
for (testName, opt, HPMClist) in benchmarks: for (testName, opt, HPMClist) in benchmarks:
for field in HPMClist: for field in HPMClist:
value = HPMClist[field] value = HPMClist[field]
@ -133,17 +134,40 @@ def ComputeAverage(benchmarks):
average[field] = value average[field] = value
else: else:
average[field] += value average[field] += value
index += 1
benchmarks.append(('All', '', average)) benchmarks.append(('All', '', average))
def FormatToPlot(currBenchmark): def FormatToPlot(currBenchmark):
names = [] names = []
values = [] values = []
for config in currBenchmark: for config in currBenchmark:
print ('config' , config) #print ('config' , config)
names.append(config[0]) names.append(config[0])
values.append(config[1]) values.append(config[1])
return (names, values) return (names, values)
def GeometricAverage(benchmarks, field):
Product = 1
index = 0
for (testName, opt, HPMCList) in benchmarks:
#print(HPMCList)
Product *= HPMCList[field]
index += 1
return Product ** (1.0/index)
def ComputeGeometricAverage(benchmarks):
fields = ['BDMR', 'BTMR', 'RASMPR', 'ClassMPR', 'ICacheMR', 'DCacheMR']
AllAve = {}
for field in fields:
Product = 1
index = 0
for (testName, opt, HPMCList) in benchmarks:
#print(HPMCList)
Product *= HPMCList[field]
index += 1
AllAve[field] = Product ** (1.0/index)
benchmarks.append(('All', '', AllAve))
if(sys.argv[1] == '-b'): if(sys.argv[1] == '-b'):
configList = [] configList = []
summery = 0 summery = 0
@ -152,22 +176,24 @@ if(sys.argv[1] == '-b'):
sys.argv = sys.argv[1::] sys.argv = sys.argv[1::]
for config in sys.argv[2::]: for config in sys.argv[2::]:
benchmarks = ProcessFile(config) benchmarks = ProcessFile(config)
ComputeAverage(benchmarks) #ComputeArithmeticAverage(benchmarks)
ComputeAll(benchmarks) ComputeAll(benchmarks)
ComputeGeometricAverage(benchmarks)
print('CONFIG: %s GEO MEAN: %f' % (config, GeometricAverage(benchmarks, 'BDMR')))
configList.append((config.split('.')[0], benchmarks)) configList.append((config.split('.')[0], benchmarks))
# Merge all configruations into a single list # Merge all configruations into a single list
benchmarkAll = [] benchmarkAll = []
for (config, benchmarks) in configList: for (config, benchmarks) in configList:
print(config) #print(config)
for benchmark in benchmarks: for benchmark in benchmarks:
(nameString, opt, dataDict) = benchmark (nameString, opt, dataDict) = benchmark
print("BENCHMARK") #print("BENCHMARK")
print(nameString) #print(nameString)
print(opt) #print(opt)
print(dataDict) #print(dataDict)
benchmarkAll.append((nameString, opt, config, dataDict)) benchmarkAll.append((nameString, opt, config, dataDict))
print('ALL!!!!!!!!!!') #print('ALL!!!!!!!!!!')
#for bench in benchmarkAll: #for bench in benchmarkAll:
# print('BENCHMARK') # print('BENCHMARK')
# print(bench) # print(bench)