Skip to content
Snippets Groups Projects
Commit e1795b9a authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

No memory increase on first retry

parent d222ae11
No related branches found
No related tags found
No related merge requests found
......@@ -6,18 +6,17 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.function.CommandLineFunction
/**
* Created by pjvanthof on 01/10/15.
* This trait will control resources given to a CommandlineFunction
*/
trait CommandLineResources extends CommandLineFunction with Configurable {
def defaultThreads = 1
final def threads = nCoresRequest match {
case Some(i) => i
case _ => {
case _ =>
val t = getThreads
nCoresRequest = Some(t)
t
}
}
var vmem: Option[String] = config("vmem")
......@@ -64,23 +63,26 @@ trait CommandLineResources extends CommandLineFunction with Configurable {
nCoresRequest = Option(threads)
/** The 1e retry does not yet upgrade the memory */
val retryMultipler = if (retry > 1) retry - 1 else 0
_coreMemory = config("core_memory", default = defaultCoreMemory).asDouble +
(0.5 * retry)
(0.5 * retryMultipler)
if (config.contains("memory_limit")) memoryLimit = config("memory_limit")
else memoryLimit = Some(_coreMemory * threads)
if (config.contains("resident_limit")) residentLimit = config("resident_limit")
else residentLimit = Some((_coreMemory + (0.5 * retry)) * residentFactor)
else residentLimit = Some((_coreMemory + (0.5 * retryMultipler)) * residentFactor)
if (!config.contains("vmem")) vmem = Some((_coreMemory * (vmemFactor + (0.5 * retry))) + "G")
if (!config.contains("vmem")) vmem = Some((_coreMemory * (vmemFactor + (0.5 * retryMultipler))) + "G")
jobName = configName + ":" + (if (firstOutput != null) firstOutput.getName else jobOutputFile)
}
override def setupRetry(): Unit = {
super.setupRetry()
if (vmem.isDefined) jobResourceRequests = jobResourceRequests.filterNot(_.contains("h_vmem="))
logger.info("Auto raise memory on retry")
if (retry > 0) logger.info("Auto raise memory on retry")
retry += 1
this.freeze()
}
......
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