Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMC-SOG
experiments
hybrid
Commits
1ceaaa08
Commit
1ceaaa08
authored
Jun 10, 2020
by
Jaime Arias
Browse files
fix: look for errors before anything
parent
7cb023fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/csv_generator.py
View file @
1ceaaa08
...
...
@@ -26,6 +26,7 @@ def get_time(experiment, tool):
regex_false
=
r
''
regex_time
=
r
''
regex_explored
=
re
.
compile
(
r
'Explored (\d+) states'
)
regex_error
=
re
.
compile
(
r
'Error'
)
filename
=
""
name
,
extension
=
os
.
path
.
splitext
(
experiment
)
...
...
@@ -49,26 +50,31 @@ def get_time(experiment, tool):
with
open
(
filename
,
mode
=
'r'
)
as
output_file
:
file_content
=
output_file
.
read
()
match_error
=
regex_error
.
search
(
file_content
)
match_true
=
regex_true
.
search
(
file_content
)
match_false
=
regex_false
.
search
(
file_content
)
match_time
=
regex_time
.
search
(
file_content
)
match_explored
=
regex_explored
.
search
(
file_content
)
# property verificati
on
explored_states
=
N
on
e
verification
=
None
if
match_true
:
verification
=
'T'
elif
match_false
:
verification
=
'F'
# get time
time_s
=
None
if
match_time
:
time
=
float
(
match_time
.
group
(
1
))
time_s
=
time
/
1000.
if
(
tool
==
'pmc-sog'
)
else
time
if
not
match_error
:
# 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
explored_states
=
match_explored
.
group
(
1
)
if
match_explored
else
None
if
match_explored
:
explored_states
=
match_explored
.
group
(
1
)
output
=
{
"elapsed_time"
:
time_s
,
...
...
@@ -93,7 +99,7 @@ def check_error(experiment):
Error code
"""
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
)
error_file
=
'{}.err'
.
format
(
name
)
...
...
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