From 21aab5eb0b33ed084208454dc59a3bc98e145169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20F=2E=20Zulian?= Date: Tue, 31 May 2016 16:41:26 +0200 Subject: [PATCH] Special treatment for the bank overlap metric. Our C++ python interface expects a single return value from the python script for each metric. --- DRAMSys/analyzer/scripts/metrics.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/DRAMSys/analyzer/scripts/metrics.py b/DRAMSys/analyzer/scripts/metrics.py index bbac938f..4c594b15 100644 --- a/DRAMSys/analyzer/scripts/metrics.py +++ b/DRAMSys/analyzer/scripts/metrics.py @@ -453,9 +453,22 @@ def calculateMetrics(pathToTrace): if (len(getThreads(connection)) == 1): for metric in metrics: - res = (metric.__name__.replace("_", " "), metric(connection)) + mres = metric(connection) + mname = metric.__name__.replace("_", " ") + res = (mname, mres) + + if (metric.__name__ == "bank_overlap_ratio"): + values = mres.split(",") + nbanks = 0 + for v in values: + name = mname + " (" + str(nbanks) + " banks active)" + nbanks = nbanks + 1 + r = (name, float(v)) + calculatedMetrics.append(r) + else: + calculatedMetrics.append(res) + print("{0}: {1}".format(res[0], res[1])) - calculatedMetrics.append(res) if (len(getThreads(connection)) > 1): # for thread in getThreads(connection):