Commit a687d5c7 authored by Noric Couderc's avatar Noric Couderc
Browse files

Fix: Normalize benchmark IDs when printing

If we used a "Tracer" collection, the name would end up in the printed
output. We implement a function that removes that, so that it looks like
we used one of the normal collections.
parent 5407d397
...@@ -13,13 +13,17 @@ class SyntheticBenchmarkExperimentPrinter (out : Writer, ...@@ -13,13 +13,17 @@ class SyntheticBenchmarkExperimentPrinter (out : Writer,
val papiRunner: PapiTracerRunner): val papiRunner: PapiTracerRunner):
SyntheticBenchmarkDataPrinter(out, methodPrintFormat) { SyntheticBenchmarkDataPrinter(out, methodPrintFormat) {
private fun normalize(benchmarkIdentifier : String) : String {
return benchmarkIdentifier.replace("Tracer", "")
}
override fun printBenchmarkRows(syntheticBenchmark: BCBenchmarkPackage<*>) { override fun printBenchmarkRows(syntheticBenchmark: BCBenchmarkPackage<*>) {
val exp = Experiment(numberRuns, syntheticBenchmark, features, papiRunner) val exp = Experiment(numberRuns, syntheticBenchmark, features, papiRunner)
val results = exp.run().map { it.strict() } val results = exp.run().map { it.strict() }
results.forEach { results.forEach {
it.values.entries.forEach { entry -> it.values.entries.forEach { entry ->
printer.printRecord( printer.printRecord(
it.benchmark.benchmarkIdentifier, normalize(it.benchmark.benchmarkIdentifier),
it.iterationNumber, it.iterationNumber,
entry.key.toCSVFeature(), entry.key.toCSVFeature(),
entry.key.toCSVFeatureType(), entry.key.toCSVFeatureType(),
......
...@@ -21,7 +21,7 @@ import java.io.PrintStream ...@@ -21,7 +21,7 @@ import java.io.PrintStream
*/ */
open class PapiTracerRunner() : PapiRunner() { open class PapiTracerRunner() : PapiRunner() {
private fun createTracerCollection(bench: BCBenchmarkPackage<*>): Any? { internal fun createTracerCollection(bench: BCBenchmarkPackage<*>): Any? {
// Sometimes we used a tracer collection, we want to replace it anyway. // Sometimes we used a tracer collection, we want to replace it anyway.
val collectionName = bench.dataStructureSimpleName.removeSuffix("Tracer") val collectionName = bench.dataStructureSimpleName.removeSuffix("Tracer")
val fakeLocation = bench.benchmarkIdentifier.removeSuffix("Tracer") val fakeLocation = bench.benchmarkIdentifier.removeSuffix("Tracer")
...@@ -221,12 +221,16 @@ class MockupPapiTracerRunner() : PapiTracerRunner() { ...@@ -221,12 +221,16 @@ class MockupPapiTracerRunner() : PapiTracerRunner() {
PAPICounter("PAPI_BR_CN"), PAPICounter("PAPI_BR_CN"),
PAPICounter("PAPI_L1_DCM"), PAPICounter("PAPI_L1_DCM"),
PAPICounter("PAPI_L1_DCA")) PAPICounter("PAPI_L1_DCA"))
val collection = createTracerCollection(syntheticBenchmark)
syntheticBenchmark.datastructure = collection
return syntheticBenchmark.trace.flatMap { method -> return syntheticBenchmark.trace.flatMap { method ->
val methodOtherFormat = methodNameTable2.inverseBidiMap()[method] val methodOtherFormat = methodNameTable2.inverseBidiMap()[method]
counters.map { counter -> counters.map { counter ->
TraceRecord( TraceRecord(
"alloc1", counter.toHexa(), 1000, "alloc1", counter.toHexa(), 1000,
syntheticBenchmark.dataStructureName.removeSuffix("Tracer"), syntheticBenchmark.dataStructureName,
methodOtherFormat ?: method methodOtherFormat ?: method
) )
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment