Skip to content

Commit

Permalink
Removed old benchmark debugging code; added new debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
jenna committed Nov 14, 2023
1 parent 2b27ce8 commit 6586aca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/gvc/benchmarking/BaselineChecker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import gvc.weaver._
object BaselineChecker {

def check(program: IR.Program, onlyFraming: Boolean = false): Unit = {
program.structs.foreach{s => s.fields.foreach { f => println(f.name)}}
val structIds =
program.structs.map(s => (s.name, s.addField("_id", IR.IntType))).toMap
program.structs.foreach{s => s.fields.foreach { f => println(f.name)}}
val runtime = CheckRuntime.addToIR(program)
val checks = new CheckImplementation(program, runtime, structIds)

Expand Down
16 changes: 3 additions & 13 deletions src/main/scala/gvc/benchmarking/BenchmarkExecutor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -252,23 +252,18 @@ object BenchmarkExecutor {
BaselineChecker.check(ir, onlyFraming)
val sourceText =
IRPrinter.print(ir, includeSpecs = false)

println(".verified.c0")
println(sourceText)

this.injectAndWrite(sourceText, tempSource)
Files.deleteIfExists(tempBinary)
val cc0perf = Timing.compileTimed(
Timing.compileTimed(
tempSource,
tempBinary,
baseConfig,
config.workload.staticIterations,
config.profilingDirectory.nonEmpty,
ongoingProcesses
)
Output.info(
s"CompileTimed: Mean: ${cc0perf.mean} Median: ${cc0perf.median}, "
)

Some(tempBinary)
}

Expand Down Expand Up @@ -300,9 +295,6 @@ object BenchmarkExecutor {

val reconstructedSourceText =
IRPrinter.print(convertedToIR, includeSpecs = true)

println("Source: ")
println(reconstructedSourceText)

conn.dynamicModes.get(reserved.measurementMode) match {
case Some(mode) =>
Expand Down Expand Up @@ -357,9 +349,7 @@ object BenchmarkExecutor {
case Some(value) => value.complete()
case None =>
}
Output.info(
s"Permutation ID: ${reserved.perm.id}, Mean: ${p.mean}. Median: ${p.median}, "
)

DAO.completeProgramMeasurement(
id,
reserved,
Expand Down
7 changes: 7 additions & 0 deletions src/main/scala/gvc/weaver/CheckImplementation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ class CheckImplementation(
): Seq[IR.Op] = {
val convertedMember = context.convertFieldMember(member)
val struct = convertedMember.field.struct
println(struct.fields.length)
val idFieldExists = struct.fields.exists(fld => {
fld.name == "_id"
})
if (!idFieldExists) {
throw new WeaverException("Couldn't locate _id field")
}
val instanceId =
if (convertedMember.root.valueType.isDefined) {
mode match {
Expand Down

0 comments on commit 6586aca

Please sign in to comment.