Commit 875f1a56 authored by Noric Couderc's avatar Noric Couderc
Browse files

Refactoring: Removed parameter for RunSpec

PapiBenchmarkAnalyzer.RunSpec doesn't take
the number of iterations as a parameter anymore, as that's a parameter
of the runner itself (it was always the same value used anyway).
parent aced6cb1
......@@ -6,8 +6,7 @@ import se.lth.cs.timing.OperationType
import se.lth.cs.util.Feature
interface PapiBenchmarkAnalyzer {
class RunSpec(val numRuns: Int,
val features : List<Feature>,
class RunSpec(val features : List<Feature>,
val eventSet: EventSet,
val syntheticBenchmark: BCBenchmarkPackage<*>) {
......
......@@ -64,7 +64,7 @@ open class PapiRunner(val numRuns: Int, val counters: List<PAPICounter>) : PapiB
val counterValues = counters.map { it.toPAPIConstant()!! }
val eventSet = EventSet.create(*counterValues.toIntArray())
for (b in syntheticBenchmarks) {
specification.add(PapiBenchmarkAnalyzer.RunSpec(numRuns, counters, eventSet, b))
specification.add(PapiBenchmarkAnalyzer.RunSpec(counters, eventSet, b))
}
return specification.toList()
}
......@@ -74,7 +74,7 @@ open class PapiRunner(val numRuns: Int, val counters: List<PAPICounter>) : PapiB
val writer = FileWriter("/dev/null")
val samples = mutableListOf<PapiBenchmarkAnalyzer.BenchmarkRunData>()
for (i in 0 until spec.numRuns) {
for (i in 0 until numRuns) {
val app = spec.syntheticBenchmark
val evset = spec.eventSet
// We do the measurements
......@@ -203,7 +203,7 @@ class MockupPapiRunner(numRuns : Int, counters : List<PAPICounter>) : PapiRunner
// Pair("PAPI_TOT_INS", 3)
// )
// val n = seed + counterToInt[spec.counter]!!
val iterations = 0 until spec.numRuns
val iterations = 0 until numRuns
return iterations.map {
val samples = spec.counters().map {
PapiBenchmarkAnalyzer.BenchmarkRunSample(it, 10000.0)
......
......@@ -110,7 +110,7 @@ class PapiTracerRunner(numRuns : Int, counters : List<PAPICounter>) : PapiRunner
// Shouldn't happen with more elements
}
val rangeIterations = 0 until spec.numRuns
val rangeIterations = 0 until numRuns
return rangeIterations.map {
runIteration(spec.syntheticBenchmark)
......
......@@ -21,11 +21,12 @@ class Experiment(val numberIterations : Int,
val eventSetBuilder = EventSetBuilder()
eventSetBuilder.visitFeatureSet(features)
val counters = eventSetBuilder.getCounterSet()
val papiRunner = PapiTracerRunner(numberIterations, counters.toList())
val evSet = eventSetBuilder.getEventSet()
val iterations = papiRunner.runIterations(
PapiBenchmarkAnalyzer.RunSpec(numberIterations, counters.toList(), evSet, benchmark)
PapiBenchmarkAnalyzer.RunSpec(counters.toList(), evSet, benchmark)
)
var iterationNumber = 0
......
......@@ -174,7 +174,6 @@ public class PapiRunnerTest {
);
Assertions.assertTrue(r.canBeSampled());
Assertions.assertEquals(runner.getNumRuns(), r.getNumRuns());
}
}
......
......@@ -152,7 +152,7 @@ class TracingCollectionRunnerTest {
fun testRunSpec(seed : Long) {
val bench = BCBenchmarkPackage.LIST(seed, 10, 0, ArrayList<Int>())
val spec = PapiBenchmarkAnalyzer.RunSpec(10,
val spec = PapiBenchmarkAnalyzer.RunSpec(
listOf(PAPICounter("PAPI_TOT_CYC")),
EventSet.create(Constants.PAPI_TOT_CYC),
bench)
......
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