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,
val papiRunner: PapiTracerRunner):
SyntheticBenchmarkDataPrinter(out, methodPrintFormat) {
private fun normalize(benchmarkIdentifier : String) : String {
return benchmarkIdentifier.replace("Tracer", "")
}
override fun printBenchmarkRows(syntheticBenchmark: BCBenchmarkPackage<*>) {
val exp = Experiment(numberRuns, syntheticBenchmark, features, papiRunner)
val results = exp.run().map { it.strict() }
results.forEach {
it.values.entries.forEach { entry ->
printer.printRecord(
it.benchmark.benchmarkIdentifier,
normalize(it.benchmark.benchmarkIdentifier),
it.iterationNumber,
entry.key.toCSVFeature(),
entry.key.toCSVFeatureType(),
......
......@@ -21,7 +21,7 @@ import java.io.PrintStream
*/
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.
val collectionName = bench.dataStructureSimpleName.removeSuffix("Tracer")
val fakeLocation = bench.benchmarkIdentifier.removeSuffix("Tracer")
......@@ -221,12 +221,16 @@ class MockupPapiTracerRunner() : PapiTracerRunner() {
PAPICounter("PAPI_BR_CN"),
PAPICounter("PAPI_L1_DCM"),
PAPICounter("PAPI_L1_DCA"))
val collection = createTracerCollection(syntheticBenchmark)
syntheticBenchmark.datastructure = collection
return syntheticBenchmark.trace.flatMap { method ->
val methodOtherFormat = methodNameTable2.inverseBidiMap()[method]
counters.map { counter ->
TraceRecord(
"alloc1", counter.toHexa(), 1000,
syntheticBenchmark.dataStructureName.removeSuffix("Tracer"),
syntheticBenchmark.dataStructureName,
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