From dcf4ee7daefa657b33746bf7ed2cedc04b0205c5 Mon Sep 17 00:00:00 2001 From: ist187691 Date: Tue, 18 May 2021 19:01:19 +0100 Subject: [PATCH] add make_time_table script --- scripts/make_time_table.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scripts/make_time_table.py diff --git a/scripts/make_time_table.py b/scripts/make_time_table.py new file mode 100644 index 0000000..c3630e0 --- /dev/null +++ b/scripts/make_time_table.py @@ -0,0 +1,21 @@ +from tabulate import tabulate + +def read_time(path: str) -> str: + with open(path, 'r') as f: + return f.read() + +trees = ["20 1000000 0", "3 5000000 0", "4 10000000 0", "3 20000000 0", "4 20000000 0"] + +process_counts = ["1", "2", "4", "8", "16", "32", "64"] + +table = [[tree] for tree in trees] + +for line, tree in zip(table, trees): + tree_file = tree.replace(" ", "-") + ".time" + for count in process_counts: + path = f"exec_times/{count}/{tree_file}" + line.append(read_time(path)) + +headers = ["Arguments", *(f"{count}" for count in process_counts)] + +print(tabulate(table, headers=headers, tablefmt="github")) \ No newline at end of file