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

Papi runner directs results to /dev/null

The result of a benchmark is written to /dev/null so that the JVM does not
discard the result straight away.
parent 3a2b70d3
......@@ -5,6 +5,8 @@ import papi.Papi
import papi.PapiException
import se.lth.cs.ApplicationGeneration.ListApplicationGenerator
import java.io.File
import java.io.FileWriter
import java.io.Writer
import java.time.Duration
import java.time.Instant
import kotlin.system.exitProcess
......@@ -122,6 +124,9 @@ open class PapiRunner(counters: CounterSpecification) {
private fun runApplication(numRuns: Int, evset: EventSet, app: Application<*>) : MutableList<Long> {
// We run it n times
val writer = FileWriter("/dev/null")
var values = mutableListOf<Long>()
for (run in 0 until numRuns) {
// We do the measurements
......@@ -130,10 +135,13 @@ open class PapiRunner(counters: CounterSpecification) {
evset.stop()
app.reset(0)
//println(result)
writer.write(result.toString())
// We record the data
values.addAll(evset.counters.toList())
}
writer.close()
return values
}
......
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