Commit a5a9f4b1 authored by Sander van der Zeeuw's avatar Sander van der Zeeuw
Browse files

refactor memorylimit

parent 46f8b1b5
......@@ -28,7 +28,7 @@ trait CommandLineResources extends CommandLineFunction with Configurable {
var residentFactor: Double = config("resident_factor", default = 1.2)
private var _coreMemory: Double = 2.0
def coreMemeory = _coreMemory
def coreMemory = _coreMemory
var retry = 0
......@@ -89,7 +89,7 @@ trait CommandLineResources extends CommandLineFunction with Configurable {
commands.foreach(_.setResources())
nCoresRequest = Some(commands.map(_.threads).sum)
_coreMemory = commands.map(cmd => cmd.coreMemeory * (cmd.threads.toDouble / threads.toDouble)).sum
_coreMemory = commands.map(cmd => cmd.coreMemory * (cmd.threads.toDouble / threads.toDouble)).sum
memoryLimit = Some(_coreMemory * threads)
residentLimit = Some((_coreMemory + (0.5 * retry)) * residentFactor)
vmem = Some((_coreMemory * (vmemFactor + (0.5 * retry))) + "G")
......
......@@ -29,6 +29,8 @@ class WigToBigWig(val root: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Input wig file")
var inputWigFile: File = _
override def defaultCoreMemory = 3.0
@Input(doc = "Input chrom sizes file", required = true)
var inputChromSizesFile: File = _
......
......@@ -27,7 +27,7 @@ class SamtoolsSort(val root: Configurable) extends Samtools {
}
def cmdLine = required(executable) + required("sort") +
optional("-m", (coreMemeory + "G")) +
optional("-m", (coreMemory + "G")) +
optional("-@", threads) +
optional("-O", outputFormat) +
required("-T", prefix) +
......
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