Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
genotoul-bioinfo
jflow
Commits
36e4b0bf
Commit
36e4b0bf
authored
Apr 21, 2016
by
Jerome Mariette
Browse files
give the component the batch options it can use
parent
c5822f8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/jflow/component.py
View file @
36e4b0bf
...
...
@@ -16,6 +16,7 @@
#
import
os
import
re
import
sys
import
inspect
import
tempfile
...
...
@@ -49,6 +50,19 @@ class Component(object):
if
isinstance
(
self
.
version
,
bytes
):
self
.
version
=
self
.
version
.
decode
()
self
.
batch_options
=
self
.
config_reader
.
get_component_batch_options
(
self
.
__class__
.
__name__
)
# in case of SGE, parse the cpu and memory parameter
type
,
options
,
limit_submission
=
self
.
jflow_config_reader
.
get_batch
()
if
type
.
lower
()
==
"sge"
:
try
:
self
.
__cpu
=
int
(
re
.
match
(
r
'.*-pe\s+(\w+)\s+(\d+)\s?.*'
,
self
.
batch_options
).
group
(
2
))
self
.
__memory
=
int
(
re
.
match
(
r
'.*-l\s+mem=(\d+\S+)\s?.*'
,
self
.
batch_options
))
except
:
pass
def
get_cpu
(
self
):
return
self
.
__cpu
def
get_memory
(
self
):
return
self
.
__memory
def
is_dynamic
(
self
):
return
len
(
self
.
get_dynamic_outputs
())
!=
0
...
...
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