Commit 183049b7 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

handle reseted component from the status

parent 7a989a68
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment