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