Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
a4bacc87
Commit
a4bacc87
authored
Jun 23, 2014
by
Peter van 't Hof
Browse files
Moved getThreads to BiopetCommandLineFunction
parent
ea4f80e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
View file @
a4bacc87
...
...
@@ -9,11 +9,7 @@ import scala.util.matching.Regex
import
nl.lumc.sasc.biopet.core.config._
abstract
class
BiopetCommandLineFunction
extends
CommandLineFunction
with
Configurable
{
// val globalConfig: Config
analysisName
=
getClass
.
getSimpleName
// protected var config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName.toLowerCase), globalConfig)
// logger.debug("config passed for " + analysisName)
// logger.debug("config for " + analysisName + ": " + config)
@Input
(
doc
=
"deps"
,
required
=
false
)
var
deps
:
List
[
File
]
=
Nil
...
...
@@ -35,11 +31,6 @@ abstract class BiopetCommandLineFunction extends CommandLineFunction with Config
protected
def
afterGraph
{
}
// def setConfig(name:String) {
// analysisName = name
// config = Config.mergeConfigs(config.getAsConfig(analysisName.toLowerCase), config)
// }
override
def
freezeFieldValues
()
{
checkExecuteble
afterGraph
...
...
@@ -115,4 +106,18 @@ abstract class BiopetCommandLineFunction extends CommandLineFunction with Config
logger
.
warn
(
"Version command: '"
+
versionCommand
+
"' give a exit code 0 but no version was found, executeble oke?"
)
return
"N/A"
}
def
getThreads
(
default
:
Int
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
8
)
val
threads
:
Int
=
config
(
"threads"
,
default
)
if
(
maxThreads
>
threads
)
return
threads
else
return
maxThreads
}
def
getThreads
(
default
:
Int
,
module
:
String
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
8
,
module
)
val
threads
:
Int
=
config
(
"threads"
,
default
,
module
)
if
(
maxThreads
>
threads
)
return
threads
else
return
maxThreads
}
}
biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/config/Configurable.scala
View file @
a4bacc87
...
...
@@ -28,21 +28,6 @@ trait Configurable extends Logging {
implicit
def
configValue2stringList
(
value
:
ConfigValue
)
=
Configurable
.
any2stringList
(
value
.
value
)
implicit
def
configValue2stringSet
(
value
:
ConfigValue
)
=
Configurable
.
any2stringList
(
value
.
value
).
toSet
implicit
def
configValue2map
(
value
:
ConfigValue
)
=
Configurable
.
any2map
(
value
.
value
)
def
getThreads
(
default
:
Int
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
8
)
val
threads
:
Int
=
config
(
"threads"
,
default
)
if
(
maxThreads
>
threads
)
return
threads
else
return
maxThreads
}
def
getThreads
(
default
:
Int
,
module
:
String
)
:
Int
=
{
val
maxThreads
:
Int
=
config
(
"maxthreads"
,
8
,
module
)
val
threads
:
Int
=
config
(
"threads"
,
default
,
module
)
if
(
maxThreads
>
threads
)
return
threads
else
return
maxThreads
}
}
object
Configurable
extends
Logging
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment