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

Fix: Ignore overflowing PAPI counters

If there's an overflow, the counter is silently reset. I added a test
that should trigger. Running another experiment afterwards should
still work!
parent fb510559
......@@ -47,6 +47,37 @@ class ExperimentTest {
results.flatMap{ it.values.keys }.toSet())
}
@Test
fun testOverflowExperiment() {
val longBench = BCBenchmarkPackage.LIST(1234, 1000000, 0, ArrayList<Int>())
val shortBench = BCBenchmarkPackage.LIST(1234, 100, 0, ArrayList<Int>())
val costPerDelete = CostFeature(OperationType.DELETE)
val cacheMissRate = FeatureRatio(
PAPICounter("PAPI_L2_DCM"),
PAPICounter("PAPI_L2_DCA")
)
val exp = Experiment(10, longBench,
FeatureSet(
PAPICounter("PAPI_TOT_INS"),
PAPICounter("PAPI_TOT_CYC"),
cacheMissRate,
costPerDelete
),
runner
)
// This should trigger an overflow but it's silent
val results = exp.run().collect(Collectors.toList())
Assertions.assertTrue(results.all { it.values[PAPICounter("PAPI_TOT_CYC")]!! > 0.0 })
// Running another experiment afterwards should still work.
val exp2 = Experiment(10, shortBench, FeatureSet(PAPICounter("PAPI_TOT_CYC")), runner)
exp2.run()
}
@Test
fun testExperiment2() {
// This time, with more complicated features
......
No preview for this file type
Markdown is supported
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