Commit e0a73b48 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Tweaking setting after testing

parent 81999541
......@@ -37,13 +37,11 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
var vmem: Option[String] = config("vmem")
protected val defaultCoreMemory: Double = 1.0
var vmemFactor: Double = config("vmem_factor", default =
this match {
case _: BiopetJavaCommandLineFunction => 2.5
case _ => 1.5
})
var vmemFactor: Double = config("vmem_factor", default = 1.5)
var ressFactor: Double = config("vmem_factor", default = 1.2)
private var coreMemory: Double = config("core_memory", default = defaultCoreMemory)
private var coreMemory: Double = _
var executable: String = _
......@@ -65,25 +63,29 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
if (threads == 0) threads = getThreads(defaultThreads)
if (threads > 1) nCoresRequest = Option(threads)
if (memoryLimit.isEmpty) memoryLimit = Some(coreMemory * threads)
coreMemory = config("core_memory", default = defaultCoreMemory).asDouble + (0.5 * retry)
if (config.contains("memory_limit")) memoryLimit = config("memory_limit")
else memoryLimit = Some(coreMemory * threads)
if (vmem.isEmpty) vmem = Some((defaultCoreMemory * vmemFactor) + "G")
if (config.contains("resident_limit")) memoryLimit = config("resident_limit")
else residentLimit = Some((coreMemory + (0.5 * retry)) * ressFactor)
if (!config.contains("vmem")) vmem = Some((coreMemory * (vmemFactor + (0.5 * retry))) + "G")
if (vmem.isDefined) jobResourceRequests :+= "h_vmem=" + vmem.get
jobName = configName + ":" + (if (firstOutput != null) firstOutput.getName else jobOutputFile)
super.freezeFieldValues()
}
var retry = 0
override def setupRetry(): Unit = {
super.setupRetry()
if (vmem.isDefined) jobResourceRequests = jobResourceRequests.filterNot(_.contains("h_vmem="))
logger.info("Auto raise memory on retry")
coreMemory += 1.0
vmemFactor += 0.5
memoryLimit = Some(coreMemory * threads)
if (vmem.isDefined) jobResourceRequests = jobResourceRequests.filter(_ != "h_vmem=" + vmem.get)
vmem = Some((defaultCoreMemory * vmemFactor) + "G")
jobResourceRequests :+= "h_vmem=" + vmem.get
retry += 1
this.freeze()
}
/** can override this value is executable may not be converted to CanonicalPath */
......
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