Skip to content

Commit

Permalink
Ignore a run if the MMTk statistics have unmatched key/value (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsoon authored Nov 14, 2023
1 parent 0c3bdd0 commit a0f1275
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ def insert_data(key, x):
if "MMTk Statistics Totals" in line:
mmtk_keys = lines[i + 1].decode('utf-8').split()
mmtk_values = lines[i + 2].decode('utf-8').split()
assert len(mmtk_keys) == len(mmtk_values), "Error when reading MMTk statistics: num of keys does not match num of values"
for j in range(0, len(mmtk_keys)):
insert_data(mmtk_keys[j], float(mmtk_values[j]))
if len(mmtk_keys) == len(mmtk_values):
for j in range(0, len(mmtk_keys)):
insert_data(mmtk_keys[j], float(mmtk_values[j]))
else:
print(f"Unable to correctly parse values from {log_file}.")
print(f"* We have {len(mmtk_keys)} keys but {len(mmtk_values)} values.")
print(f"* This run will be ignored.")

# initialie execution_times to empty in case all runs failed
ret['execution_times'] = []
Expand Down

0 comments on commit a0f1275

Please sign in to comment.