Commit f9e9e0ff authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

FilesParser: raise exception if the per-thread perf for this thread already exists

parent ef4919fc
......@@ -324,20 +324,19 @@ class FilesParser:
def line_to_dict(l):
words = l.strip().split()[-7:]
values = list(map(float, words[1:]))
r = {int(words[0]) : {
CompMetric.BANDWIDTH: {
'min': values[0],
'avg': values[1],
'max': values[2]
},
CompMetric.TIME: {
'min': values[3],
'avg': values[4],
'max': values[5]
}
r = {
CompMetric.BANDWIDTH: {
'min': values[0],
'avg': values[1],
'max': values[2]
},
CompMetric.TIME: {
'min': values[3],
'avg': values[4],
'max': values[5]
}
}
return r
return int(words[0]), r
def rearrange_dict(d):
nb_threads = len(d)
......@@ -359,9 +358,15 @@ class FilesParser:
in_result_per_thread_with_comm = False
in_result_per_thread_without_comm = True
elif in_result_per_thread_with_comm:
results["with_comm"].update(line_to_dict(lines[i]))
key, value = line_to_dict(lines[i])
if key in results["with_comm"]:
raise Exception(f"Key '{key}' already present in with_comm.")
results["with_comm"][key] = value
elif in_result_per_thread_without_comm:
results["without_comm"].update(line_to_dict(lines[i]))
key, value = line_to_dict(lines[i])
if key in results["without_comm"]:
raise Exception(f"Key '{key}' already present in without_comm.")
results["without_comm"][key] = value
if len(results["without_comm"]) == nb_threads:
break
......
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