Commit 1ceaaa08 authored by Jaime Arias's avatar Jaime Arias
Browse files

fix: look for errors before anything

parent 7cb023fa
...@@ -26,6 +26,7 @@ def get_time(experiment, tool): ...@@ -26,6 +26,7 @@ def get_time(experiment, tool):
regex_false = r'' regex_false = r''
regex_time = r'' regex_time = r''
regex_explored = re.compile(r'Explored (\d+) states') regex_explored = re.compile(r'Explored (\d+) states')
regex_error = re.compile(r'Error')
filename = "" filename = ""
name, extension = os.path.splitext(experiment) name, extension = os.path.splitext(experiment)
...@@ -49,26 +50,31 @@ def get_time(experiment, tool): ...@@ -49,26 +50,31 @@ def get_time(experiment, tool):
with open(filename, mode='r') as output_file: with open(filename, mode='r') as output_file:
file_content = output_file.read() file_content = output_file.read()
match_error = regex_error.search(file_content)
match_true = regex_true.search(file_content) match_true = regex_true.search(file_content)
match_false = regex_false.search(file_content) match_false = regex_false.search(file_content)
match_time = regex_time.search(file_content) match_time = regex_time.search(file_content)
match_explored = regex_explored.search(file_content) match_explored = regex_explored.search(file_content)
# property verification explored_states = None
verification = None verification = None
if match_true:
verification = 'T'
elif match_false:
verification = 'F'
# get time
time_s = None time_s = None
if match_time:
time = float(match_time.group(1)) if not match_error:
time_s = time / 1000. if (tool == 'pmc-sog') else time # property verification
if match_true:
verification = 'T'
elif match_false:
verification = 'F'
# get time
if match_time:
time = float(match_time.group(1))
time_s = time / 1000. if (tool == 'pmc-sog') else time
# get explored states # get explored states
explored_states = match_explored.group(1) if match_explored else None if match_explored:
explored_states = match_explored.group(1)
output = { output = {
"elapsed_time": time_s, "elapsed_time": time_s,
...@@ -93,7 +99,7 @@ def check_error(experiment): ...@@ -93,7 +99,7 @@ def check_error(experiment):
Error code Error code
""" """
regex = re.compile( regex = re.compile(
r'(TIME LIMIT|Segmentation fault|terminate|Aborted|MDD|Invalid identifier)' r'(TIME LIMIT|Segmentation fault|terminate|Aborted|MDD|Invalid identifier|table full)'
) )
name, extension = os.path.splitext(experiment) name, extension = os.path.splitext(experiment)
error_file = '{}.err'.format(name) error_file = '{}.err'.format(name)
......
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