Skip to content
Snippets Groups Projects
Commit 0232ff00 authored by bow's avatar bow
Browse files

Merge branch 'fix-script_run_time' into 'develop'

Fix script run time

Fixes #330 

See merge request !381
parents 05629c68 6a2e56e6
No related branches found
No related tags found
No related merge requests found
......@@ -202,8 +202,16 @@ trait MultiSampleQScript extends SummaryQScript { qscript: QScript =>
/** Runs addAndTrackJobs method for each sample */
final def addSamplesJobs() {
logger.info(s"Starting script for ${samples.size} samples")
var count = 0
if (onlySamples.isEmpty || samples.forall(x => onlySamples.contains(x._1))) {
samples.foreach { case (sampleId, sample) => sample.addAndTrackJobs() }
samples.foreach { case (sampleId, sample) =>
logger.info(s"Starting script sample '$sampleId'")
sample.addAndTrackJobs()
count += 1
logger.info(s"Finish script for '$sampleId', samples done: $count / ${samples.size}")
}
logger.info("Starting script for multisample jobs")
addMultiSampleJobs()
} else onlySamples.foreach(sampleId => samples.get(sampleId) match {
case Some(sample) => sample.addAndTrackJobs()
......
......@@ -91,12 +91,12 @@ class Config(protected var _map: Map[String, Any],
else _map = mergeMaps(valueMap, _map)
}
protected[config] var notFoundCache: List[ConfigValueIndex] = List()
protected[config] var notFoundCache: Set[ConfigValueIndex] = Set()
protected[config] var fixedCache: Map[ConfigValueIndex, ConfigValue] = Map()
protected[config] var foundCache: Map[ConfigValueIndex, ConfigValue] = Map()
protected[config] var defaultCache: Map[ConfigValueIndex, ConfigValue] = Map()
protected[config] def clearCache(): Unit = {
notFoundCache = List()
notFoundCache = Set()
foundCache = Map()
defaultCache = Map()
}
......@@ -137,7 +137,7 @@ class Config(protected var _map: Map[String, Any],
foundCache += (requestedIndex -> value.get)
true
} else {
notFoundCache +:= requestedIndex
notFoundCache += requestedIndex
false
}
}
......@@ -220,7 +220,7 @@ class Config(protected var _map: Map[String, Any],
val effectiveFound = convertIndexValuesToMap(foundCache.filter(!_._2.default).toList.map(x => (x._2.requestIndex, x._2.value)), Some(false))
val effectiveFixed = convertIndexValuesToMap(fixedCache.filter(!_._2.default).toList.map(x => (x._2.requestIndex, x._2.value)), Some(false))
val effectiveDefaultFound = convertIndexValuesToMap(defaultCache.filter(_._2.default).toList.map(x => (x._2.requestIndex, x._2.value)), Some(false))
val notFound = convertIndexValuesToMap(notFoundCache.map((_, None)), Some(false))
val notFound = convertIndexValuesToMap(notFoundCache.toList.map((_, None)), Some(false))
// Merged maps
val fullEffective = ConfigUtils.mergeMaps(effectiveFound, effectiveDefaultFound)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment