Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
e1795b9a
Commit
e1795b9a
authored
9 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
No memory increase on first retry
parent
d222ae11
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/CommandLineResources.scala
+9
-7
9 additions, 7 deletions
...scala/nl/lumc/sasc/biopet/core/CommandLineResources.scala
with
9 additions
and
7 deletions
public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/CommandLineResources.scala
+
9
−
7
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
()
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment