Skip to content

Commit

Permalink
Added optimizers to evaluations.
Browse files Browse the repository at this point in the history
  • Loading branch information
bibekp committed Aug 13, 2014
1 parent 99f893a commit 3b6df85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BerlinSparqlEvaluation extends TorqueDeployableAlgorithm {
val warmupRuns = parameters("jitRepetitions").toInt

val graphBuilder = new GraphBuilder[Long, Any].withPreallocatedNodes(nodeActors)
val tr = new TripleRush(graphBuilder)
val tr = new TripleRush(graphBuilder, optimizerCreator = optimizerCreator)
println("TripleRush has been started.")

var commonResults = parameters
Expand Down Expand Up @@ -67,7 +67,7 @@ class BerlinSparqlEvaluation extends TorqueDeployableAlgorithm {
JvmWarmup.sleepUntilGcInactiveForXSeconds(60, 180)

commonResults += ((s"optimizerInitialisationTime", optimizerInitialisationTime.toString))
commonResults += ((s"optimizerName", "ExplorationOptimizer"))
commonResults += ((s"optimizerName", optimizerCreator.toString()))
commonResults += (("loadingTime", loadingTime.toString))
commonResults += s"loadNumber" -> datasetSize.toString
commonResults += s"dataSet" -> s"berlinsparql $datasetSize"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TripleRushEvaluationISWCSlurm extends TorqueDeployableAlgorithm {
val dataSource = parameters(dataSourceKey)
val rdfTypePartitioning = parameters(rdfTypePartitioningKey).toBoolean
val graphBuilder = new GraphBuilder[Long, Any]().withPreallocatedNodes(nodeActors)
val tr = new TripleRush(graphBuilder)
val tr = new TripleRush(graphBuilder, optimizerCreator)
println("TripleRush has been started.")
var commonResults = parameters
commonResults += "numberOfNodes" -> tr.graph.numberOfNodes.toString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ import com.signalcollect.triplerush.optimizers.Optimizer
import akka.actor.ActorRef
import com.signalcollect.triplerush.TriplePattern
import com.signalcollect.triplerush.evaluation.lubm.FileOperations._
import com.signalcollect.triplerush.optimizers.HeuristicOptimizerCreator

class TripleRushEvaluationSlurm extends TorqueDeployableAlgorithm {
import SlurmEvalHelpers._

/**
* For TR evaluation without counting result length
*/

val evaluationDescriptionKey = "evaluationDescription"
val warmupRunsKey = "jitRepetitions"
val datasetKey = "dataset"
val universitiesKey = "universities"
//val optimizerCreatorKey = "optimizerCreator"
val optimizerCreatorKey = "optimizerCreator"
val spreadsheetUsernameKey = "spreadsheetUsername"
val spreadsheetPasswordKey = "spreadsheetPassword"
val spreadsheetNameKey = "spreadsheetName"
Expand All @@ -43,15 +44,15 @@ class TripleRushEvaluationSlurm extends TorqueDeployableAlgorithm {
val warmupRuns = parameters(warmupRunsKey).toInt
val dataset = parameters(datasetKey)
val universities: Option[String] = parameters.get(universitiesKey)
//val optimizerCreatorName = parameters(optimizerCreatorKey)
//val optimizerCreator = getObject[Function1[TripleRush, Option[Optimizer]]](optimizerCreatorName)
val optimizerCreatorName = parameters(optimizerCreatorKey)
val optimizerCreator = getObject[Function1[TripleRush, Option[Optimizer]]](optimizerCreatorName)
val spreadsheetUsername = parameters(spreadsheetUsernameKey)
val spreadsheetPassword = parameters(spreadsheetPasswordKey)
val spreadsheetName = parameters(spreadsheetNameKey)
val worksheetName = parameters(worksheetNameKey)
val rdfTypePartitioning = parameters(rdfTypePartitioningKey).toBoolean
val graphBuilder = new GraphBuilder[Long, Any]().withPreallocatedNodes(nodeActors)
val tr = new TripleRush(graphBuilder)
val tr = new TripleRush(graphBuilder, optimizerCreator = optimizerCreator)
println("TripleRush has been started.")
var commonResults = parameters
commonResults += "numberOfNodes" -> tr.graph.numberOfNodes.toString
Expand All @@ -78,9 +79,9 @@ class TripleRushEvaluationSlurm extends TorqueDeployableAlgorithm {
} else {
LubmQueries.fullQueries
}

commonResults += ((s"optimizerInitialisationTime", optimizerInitialisationTime.toString))
commonResults += ((s"optimizerName", "ExplorationOptimizer"))
commonResults += ((s"optimizerName", optimizerCreator.toString()))
commonResults += (("loadingTime", loadingTime.toString))
commonResults += s"loadNumber" -> universities.toString
commonResults += s"dataSet" -> s"lubm$universities"
Expand All @@ -98,7 +99,7 @@ class TripleRushEvaluationSlurm extends TorqueDeployableAlgorithm {
println(s"Finished warm-up.")
JvmWarmup.sleepUntilGcInactiveForXSeconds(60)
}

val warmupTime = measureTime(warmup)
commonResults += s"warmupTime" -> warmupTime.toString

Expand All @@ -120,7 +121,7 @@ class TripleRushEvaluationSlurm extends TorqueDeployableAlgorithm {
tr.shutdown
}

def executeEvaluationRun(query: Seq[TriplePattern], queryDescription: String, queryRun: Int, tr: TripleRush, commonResults: Map[String, String]): Map[String, String] = {
def executeEvaluationRun(query: Seq[TriplePattern], queryDescription: String, queryRun: Int, tr: TripleRush, commonResults: Map[String, String]): Map[String, String] = {
val gcs = ManagementFactory.getGarbageCollectorMXBeans.toList
val compilations = ManagementFactory.getCompilationMXBean
val javaVersion = ManagementFactory.getRuntimeMXBean.getVmVersion
Expand Down

0 comments on commit 3b6df85

Please sign in to comment.