diff --git a/biopet-framework/src/main/java/nl/lumc/sasc/biopet/core/Config.scala b/biopet-framework/src/main/java/nl/lumc/sasc/biopet/core/Config.scala index 1cca58e0190566945ddc00fb1a583f7cfb30fd0f..85796a428064f910567d5972ce5a24073bf46478 100644 --- a/biopet-framework/src/main/java/nl/lumc/sasc/biopet/core/Config.scala +++ b/biopet-framework/src/main/java/nl/lumc/sasc/biopet/core/Config.scala @@ -125,6 +125,13 @@ class Config(var map: Map[String,Any]) extends Logging { } def getAsConfig(s:String) : Config = if (contains(s)) new Config(getAsMap(s)) else new Config(Map()) + def getThreads(default:Int) : Int = { + val maxThreads = this.getAsInt("maxthreads", 8) + val threads = this.getAsInt("threads", default) + if (maxThreads > threads) return threads + else return maxThreads + } + override def toString() : String = map.toString }