Commit 3358e6fb authored by Philippe SWARTVAGHER's avatar Philippe SWARTVAGHER
Browse files

Handle per-thread performances in FileParser

parent 9ca2c04c
......@@ -105,6 +105,8 @@ class FilesParser:
self.comm_lat_alone_results = {}
self.comm_lat_with_comp_results = {}
self.comp_alone_results = {} # {op => { x => {"time" => [min, avg, max], "other metric (gflops, bw, ...)" => [min, avg, max]}}}
self.comp_alone_per_thread_results = {} # {op => { x => {"time" => {"min" => [], "avg" => [], "max" => []}, "other metric (gflops, bw, ...)" => {"min" => [], "avg" => [], "max" => []}}}}
self.comp_with_comm_per_thread_results = {}
self.machine = {
"nb_pus": None,
"l3_cache_size": None, # in MB
......@@ -283,6 +285,54 @@ class FilesParser:
return results["without_comm"], results["with_comm"]
def _get_bw_time_per_thread_results(self, lines, op):
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]
}
}
}
return r
def rearrange_dict(d):
nb_threads = len(d)
return {
m: {
k: [d[i][m][k] for i in range(nb_threads)] for k in ['min', 'avg', 'max']
} for m in [CompMetric.BANDWIDTH, CompMetric.TIME]
}
results = {"without_comm": {}, "with_comm": {}}
nb_found = 0
in_result_per_thread_with_comm = False
in_result_per_thread_without_comm = False
for i in range(len(lines)):
if "results per thread (with comm):" in lines[i]:
in_result_per_thread_with_comm = True
elif "results per thread (without comm):" in lines[i]:
assert(in_result_per_thread_with_comm)
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]))
elif in_result_per_thread_without_comm:
results["without_comm"].update(line_to_dict(lines[i]))
if len(results["without_comm"]) == len(results["with_comm"]):
break
return {op: rearrange_dict(results["without_comm"])}, {op: rearrange_dict(results["with_comm"])}
def _parse_machine(self, lines):
nb_pus = None
l3_cache_size = None
......@@ -409,10 +459,13 @@ class FilesParser:
alone = None
with_comm = None
alone_per_thread = None
with_comm_per_thread = None
if compute_bench_type == Stream:
alone, with_comm = self._get_stream_results(lines, nb_cores)
elif compute_bench_type == Memset:
alone, with_comm = self._get_bw_time_results(lines, "memset", nb_cores)
alone_per_thread, with_comm_per_thread = self._get_bw_time_per_thread_results(lines, "memset")
# elif compute_bench_type == "cholesky":
# file_data["computing"] = get_cholesky_results(lines, nb_cores)
# else:
......@@ -423,6 +476,7 @@ class FilesParser:
for op in alone:
if self._nb_parsed_files == 0:
self.comp_alone_results[op] = dict()
self.comp_alone_per_thread_results[op] = dict()
elif op not in self.comp_alone_results:
raise Exception("Additionnal op not supported")
......@@ -431,9 +485,13 @@ class FilesParser:
self.comp_alone_results[op][x] = alone[op]
if alone_per_thread is not None and len(alone_per_thread[op]) > 0:
self.comp_alone_per_thread_results[op][x] = alone_per_thread[op]
for op in with_comm:
if self._nb_parsed_files == 0:
self.comp_with_comm_results[op] = dict()
self.comp_with_comm_per_thread_results[op] = dict()
elif op not in self.comp_with_comm_results:
raise Exception("Additionnal op not supported")
......@@ -442,6 +500,9 @@ class FilesParser:
self.comp_with_comm_results[op][x] = with_comm[op]
if with_comm_per_thread is not None and len(with_comm_per_thread[op]) > 0:
self.comp_with_comm_per_thread_results[op][x] = with_comm_per_thread[op]
assert(len(alone) == len(self.comp_alone_results))
assert(len(with_comm) == len(self.comp_with_comm_results))
......
Supports Markdown
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