Skip to content
GitLab
Menu
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
e1795b9a
Commit
e1795b9a
authored
Oct 29, 2015
by
Peter van 't Hof
Browse files
No memory increase on first retry
parent
d222ae11
Changes
1
Hide whitespace changes
Inline
Side-by-side
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/CommandLineResources.scala
View file @
e1795b9a
...
...
@@ -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
*
retry
Multipler
)
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
*
retry
Multipler
))
*
residentFactor
)
if
(!
config
.
contains
(
"vmem"
))
vmem
=
Some
((
_coreMemory
*
(
vmemFactor
+
(
0.5
*
retry
)))
+
"G"
)
if
(!
config
.
contains
(
"vmem"
))
vmem
=
Some
((
_coreMemory
*
(
vmemFactor
+
(
0.5
*
retry
Multipler
)))
+
"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
()
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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