Skip to content
Snippets Groups Projects
Verified Commit 4f9c1526 authored by Simon Schwitanski's avatar Simon Schwitanski :slight_smile:
Browse files

Update MUST parser

parent c4d43653
No related branches found
No related tags found
1 merge request!20Parsing and tools updates
......@@ -247,21 +247,25 @@ class V18(AbstractTool):
if os.path.exists(f):
output_strings.append(open(f).read())
output_string = ''.join(output_strings)
# if nothing was found, parsing will not continue
if json_output is None or len(output_strings) == 0:
# check if signal handler of MUST was invoked (= crash)
if re.search('caught signal nr', output_string):
return {"status": "failure"}
output_string = ''.join(output_strings)
else:
# no output, but also not a crash, check for timeout
if os.path.exists(f'{cachefile}.timeout') or os.path.exists(f'{logs_dir}/must/{cachefile}.timeout'):
return {"status": "timeout"}
else:
return {"status": "success"}
if re.search('Compilation of .*? raised an error \(retcode: ', output_string):
output = {}
output["status"] = "UNIMPLEMENTED"
return output_string
# No interesting output found, so return the timeout as is if it exists
if os.path.exists(f'{cachefile}.timeout') or os.path.exists(f'{logs_dir}/must/{cachefile}.timeout'):
return {"status": "timeout"}
output = {}
# TODO if MBB supports more than .c we need to give it the correct test file name here
test_file_name = cachefile.rsplit('_', 1)[0].strip() + ".c"
......@@ -272,14 +276,15 @@ class V18(AbstractTool):
# parse JSON output and convert to MBB format
for message in json_output["messages"]:
parsed_report = {}
# skip any information or warning
if message["type"] == "Information" or message["type"] == "Warning":
continue
parsed_report["error_class"] = self.get_mbb_error_label()[
message["error_id"]]
parsed_report["calls"] = []
parsed_report["lines"] = []
parsed_report["ranks"] = []
# skip any information
if message["type"] == "Information":
continue
# extract reporting MPI call and reporting ranks
parsed_report["calls"].append(message["from"]["call"])
......@@ -300,24 +305,12 @@ class V18(AbstractTool):
parsed_reports.append(parsed_report)
# Check for timeout is if it exists
if os.path.exists(f'{cachefile}.timeout') or os.path.exists(f'{logs_dir}/must/{cachefile}.timeout'):
output["status"] = "timeout"
else:
output["status"] = "successful"
output["messages"] = parsed_reports
return output
\ No newline at end of file
# TODO: Catch segfaults?
# if re.search('YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault', output):
# return 'segfault'
# if re.search('caught signal nr 11', output) or re.search('caught signal nr 6', output):
# return 'segfault'
# if re.search('internal ABORT - process ', output):
# return 'failure'
# if re.search('caught MPI error', output):
# # if we arrive here we, then MUST just found an MPI error, but did not detect anything, so we return 'OK'
# return 'OK'
# if re.search('Fatal error in internal_Comm_size', output):
# # if we arrive here, nothing relevant has been detected, MPI just crashed internally
# return 'OK'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment