From fec7883af9502f9c2b090856857c91f90eb799c9 Mon Sep 17 00:00:00 2001
From: DavyCats <davycats.dc@gmail.com>
Date: Thu, 5 Apr 2018 11:55:22 +0200
Subject: [PATCH] add runtime to scatterRegions

---
 biopet.wdl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/biopet.wdl b/biopet.wdl
index 2eb2988..3ae5490 100644
--- a/biopet.wdl
+++ b/biopet.wdl
@@ -32,11 +32,14 @@ task ScatterRegions {
     Int? scatterSize
     File? regions
 
+    Float? memory
+    Float? memoryMultiplier
+
     command {
         set -e -o pipefail
         ${preCommand}
         mkdir -p ${outputDirPath}
-        java -Xmx2G -jar ${tool_jar} \
+        java -Xmx${true=memory false="2" defined(memory)}G -jar ${tool_jar} \
           -R ${ref_fasta} \
           -o ${outputDirPath} \
           ${"-s " + scatterSize} \
@@ -46,6 +49,10 @@ task ScatterRegions {
     output {
         Array[File] scatters = glob(outputDirPath + "/scatter-*.bed")
     }
+
+    runtime {
+        memory: ceil(select_first([memory, 2.0]) * select_first([memoryMultiplier, 2.0]))
+    }
 }
 
 task SampleConfig {
-- 
GitLab