Commit 868c3d53 authored by Lukas Weber's avatar Lukas Weber Committed by Lukas Sommer

Added the deleteProjects flag to the DSE

parent 0bfbe567
......@@ -50,7 +50,8 @@ private class ConcreteExploration(
val designFrequency: Heuristics.Frequency,
val batchSize: Int = Exploration.MAX_BATCH_SZ,
val basePath: Path,
val debugMode: Option[String])(implicit cfg: Configuration, val tasks: Tasks) extends Exploration {
val debugMode: Option[String],
val deleteOnFail: Boolean = false)(implicit cfg: Configuration, val tasks: Tasks) extends Exploration {
private implicit val _exploration = this
private[this] val _logger = de.tu_darmstadt.cs.esa.tapasco.Logging.logger(getClass)
private var _result: Option[(DesignSpace.Element, Composer.Result)] = None
......@@ -106,7 +107,7 @@ private class ConcreteExploration(
val feasibleElem = DesignSpace.Element(run.element.composition, newFrequency, newH)
// skip feedback elements with frequency of less than 50 MHz
if (newFrequency >= 50.0) {
Seq(new ConcreteRun(nextRunId, feasibleElem, run.target, debugMode))
Seq(new ConcreteRun(nextRunId, feasibleElem, run.target, debugMode, deleteOnFail))
} else {
Seq()
}
......@@ -199,7 +200,7 @@ private class ConcreteExploration(
space.enumerate foreach { e =>
val util = AreaUtilization(target, e.composition)
require (util.nonEmpty, "area estimate must be known for all elements")
val run = new ConcreteRun(nextRunId, e, target, debugMode)
val run = new ConcreteRun(nextRunId, e, target, debugMode, deleteOnFail)
if (q.find(r =>(r compare run) == 0).isEmpty) {
publish(Exploration.Events.RunDefined(e, util.get))
q.enqueue(run)
......@@ -232,8 +233,9 @@ object Exploration {
designFrequency: Heuristics.Frequency,
batchSize: Int = MAX_BATCH_SZ,
basePath: Path,
debugMode: Option[String] = None) (implicit cfg: Configuration, tsk: Tasks): Exploration =
new ConcreteExploration(initialComposition, target, dimensions, designFrequency, batchSize, basePath, debugMode)
debugMode: Option[String] = None,
deleteOnFail: Boolean = false) (implicit cfg: Configuration, tsk: Tasks): Exploration =
new ConcreteExploration(initialComposition, target, dimensions, designFrequency, batchSize, basePath, debugMode, deleteOnFail)
// scalastyle:on parameter.number
final val MAX_BATCH_SZ: Int = 10 // FIXME use Compose.maxNumberOfThreads
......
......@@ -35,7 +35,7 @@ sealed private trait Run extends Startable with Ordered[Run] {
(that.area.utilization, that.element.h, that.element.frequency)
}
private class ConcreteRun(val no: Int, val element: DesignSpace.Element, val target: Target, val debugMode: Option[String])
private class ConcreteRun(val no: Int, val element: DesignSpace.Element, val target: Target, val debugMode: Option[String], val deleteOnFail: Boolean = false)
(implicit exploration: Exploration, configuration: Configuration) extends Run {
private[this] var _result: Option[Composer.Result] = None
private[this] var _task: Option[ComposeTask] = None
......@@ -57,7 +57,7 @@ private class ConcreteRun(val no: Int, val element: DesignSpace.Element, val tar
logFile = Some("%s/%s/%s.log".format(exploration.basePath, id, id)),
debugMode = debugMode,
onComplete = res => stop(signal),
deleteOnFail = true)
deleteOnFail = deleteOnFail)
_task = Some(t)
exploration.publish(Exploration.Events.RunStarted(element, t))
exploration.tasks(t) // start task
......
......@@ -110,6 +110,6 @@ private object DesignSpaceExploration extends Executor[DesignSpaceExplorationJob
None, // logfile
job.debugMode,
onComplete,
deleteOnFail = job.deleteProjects getOrElse(false)
deleteOnFail = job.deleteProjects getOrElse false
)
}
......@@ -75,7 +75,8 @@ private class DesignSpaceExplorationTask(
designFrequency,
batchSize,
_bp,
debugMode
debugMode,
deleteOnFail
)(_cfg, tsk)
/**
......
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