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
genotoul-bioinfo
jflow
Commits
183049b7
Commit
183049b7
authored
Sep 15, 2014
by
Jerome Mariette
Browse files
handle reseted component from the status
parent
7a989a68
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/jflow/workflow.py
View file @
183049b7
...
...
@@ -88,6 +88,7 @@ class Workflow(threading.Thread):
self
.
engine_arguments
=
' --log-verbose '
self
.
component_nameids_is_init
=
False
self
.
component_nameids
=
{}
self
.
reseted_components
=
[]
# try to parse engine arguments
try
:
type
,
options
,
limit_submission
=
self
.
jflow_config_reader
.
get_batch
()
...
...
@@ -506,7 +507,8 @@ class Workflow(threading.Thread):
self
.
_serialize
()
# if collecting components and running workflow has not been done yet
if
self
.
step
==
1
:
try
:
try
:
self
.
reseted_components
=
[]
self
.
wf_execution_wrapper
()
except
SystemExit
,
e
:
self
.
status
=
self
.
STATUS_FAILED
...
...
@@ -522,7 +524,8 @@ class Workflow(threading.Thread):
self
.
_serialize
()
# if the workflow was a dynamic one
if
self
.
step
==
2
:
try
:
try
:
self
.
reseted_components
=
[]
self
.
wf_execution_wrapper
()
except
SystemExit
,
e
:
self
.
status
=
self
.
STATUS_FAILED
...
...
@@ -579,28 +582,29 @@ class Workflow(threading.Thread):
"aborted"
:
0
,
"completed"
:
0
,
"failed_commands"
:
list
()
}
try
:
log
=
MakeflowLog
(
self
.
component_nameids
[
component_nameid
])
log
.
parse
()
symbols
=
set
(
n
.
symbol
for
n
in
log
.
nodes
if
n
.
symbol
)
if
not
symbols
:
return
None
for
n
in
log
.
nodes
:
if
not
n
.
symbol
:
continue
if
n
.
symbol
==
component_nameid
:
status
[
"tasks"
]
+=
1
status
[
"time"
]
+=
n
.
elapsed_time
if
n
.
state
==
Node
.
WAITING
:
status
[
"waiting"
]
+=
1
elif
n
.
state
==
Node
.
RUNNING
:
status
[
"running"
]
+=
1
elif
n
.
state
==
Node
.
FAILED
:
status
[
"failed"
]
+=
1
status
[
"failed_commands"
].
append
(
n
.
command
)
elif
n
.
state
==
Node
.
ABORTED
:
status
[
"aborted"
]
+=
1
elif
n
.
state
==
Node
.
COMPLETED
:
status
[
"completed"
]
+=
1
except
:
pass
if
component_nameid
not
in
self
.
reseted_components
:
try
:
log
=
MakeflowLog
(
self
.
component_nameids
[
component_nameid
])
log
.
parse
()
symbols
=
set
(
n
.
symbol
for
n
in
log
.
nodes
if
n
.
symbol
)
if
not
symbols
:
return
None
for
n
in
log
.
nodes
:
if
not
n
.
symbol
:
continue
if
n
.
symbol
==
component_nameid
:
status
[
"tasks"
]
+=
1
status
[
"time"
]
+=
n
.
elapsed_time
if
n
.
state
==
Node
.
WAITING
:
status
[
"waiting"
]
+=
1
elif
n
.
state
==
Node
.
RUNNING
:
status
[
"running"
]
+=
1
elif
n
.
state
==
Node
.
FAILED
:
status
[
"failed"
]
+=
1
status
[
"failed_commands"
].
append
(
n
.
command
)
elif
n
.
state
==
Node
.
ABORTED
:
status
[
"aborted"
]
+=
1
elif
n
.
state
==
Node
.
COMPLETED
:
status
[
"completed"
]
+=
1
except
:
pass
return
status
def
reset_component
(
self
,
component_name
):
...
...
@@ -614,6 +618,7 @@ class Workflow(threading.Thread):
if
not
found
:
sys
.
stderr
.
write
(
"Impossible to reset component '"
+
component_name
+
"'! This one is not part of the workflow
\n
"
)
sys
.
exit
(
1
)
self
.
reseted_components
.
append
(
component_name
)
self
.
_serialize
()
def
makeflow_pretty_print_node
(
self
,
dag
,
node
):
...
...
Write
Preview
Markdown
is supported
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