diff --git a/qdp_project/plots/plot-timing-distprefetch.pdf b/qdp_project/plots/plot-timing-distprefetch.pdf index fc31107..c99f9c1 100644 Binary files a/qdp_project/plots/plot-timing-distprefetch.pdf and b/qdp_project/plots/plot-timing-distprefetch.pdf differ diff --git a/qdp_project/plots/plot-timing-dram.pdf b/qdp_project/plots/plot-timing-dram.pdf index 63c1191..ffa15e9 100644 Binary files a/qdp_project/plots/plot-timing-dram.pdf and b/qdp_project/plots/plot-timing-dram.pdf differ diff --git a/qdp_project/plots/plot-timing-hbm.pdf b/qdp_project/plots/plot-timing-hbm.pdf index ed9c314..198429c 100644 Binary files a/qdp_project/plots/plot-timing-hbm.pdf and b/qdp_project/plots/plot-timing-hbm.pdf differ diff --git a/qdp_project/plots/plot-timing-prefetch.pdf b/qdp_project/plots/plot-timing-prefetch.pdf index 51f72ba..f45d332 100644 Binary files a/qdp_project/plots/plot-timing-prefetch.pdf and b/qdp_project/plots/plot-timing-prefetch.pdf differ diff --git a/qdp_project/plotter.py b/qdp_project/plotter.py index 2a10485..67fc01a 100644 --- a/qdp_project/plotter.py +++ b/qdp_project/plotter.py @@ -3,6 +3,7 @@ import csv import numpy as np import pandas as pd import seaborn as sns +import plotly.express as px import matplotlib.pyplot as plt output_path = "./plots" @@ -12,10 +13,11 @@ prefetch_result = "./evaluation-results/current/qdp-xeonmax-prefetch-tca1-tcb1-t distprefetch_result = "./evaluation-results/current/qdp-xeonmax-distprefetch-tca1-tcb1-tcj1-tmul32-wl4294967296-cs8388608.csv" tt_name = "rt-ns" -function_names = [ "scana-run", "scanb-run", "aggrj-run" ] -fn_nice = [ "Scan A", "Scan B", "Aggregate" ] +function_names = ["aggrj-run" , "scana-run", "scanb-run" ] +fn_nice_prefetch = [ "Aggregate" ,"Scan A", "Scan A and B (parallel)"] +fn_nice_normal = [ "Aggregate" , "Scan A", "NULL"] -def read_timings_from_csv(fname) -> tuple[list[float], list[str]]: +def read_timings_from_csv(fname, fn_nice) -> tuple[list[float], list[str]]: t = {} row_count = 0 @@ -29,6 +31,9 @@ def read_timings_from_csv(fname) -> tuple[list[float], list[str]]: t = {key: value / (1000 * 1000 * row_count) for key, value in t.items() if value != 0} + if fn_nice[2] in t.keys(): + t[fn_nice[1]] = t[fn_nice[1]] - t[fn_nice[2]] + return list(t.values()), list(t.keys()) @@ -130,34 +135,50 @@ def tex_table(df, fname): # loops over all possible configuration combinations and calls # process_file_to_dataset for them in order to build a dataframe # which is then displayed and saved -def donut_plot(data: tuple[list[float], list[str]], fname): +def donut_plot(data: tuple[list[float], list[str]], maxtime, fname): + # pad to maxtime + data[0].append(maxtime - sum(data[0])) + data[1].append("NULL") + + # pad to only display semi-circle + data[0].append(sum(data[0])) + data[1].append("NULL") + + fig, (ax, lax) = plt.subplots(nrows=2, gridspec_kw={"height_ratios":[4, 1]}) + palette_color = sns.color_palette('mako_r') - fig, ax = plt.subplots(figsize=(6, 3), subplot_kw=dict(aspect="equal")) + wedges, texts = ax.pie(data[0], wedgeprops=dict(width=0.5), colors=palette_color) + wedges[-1].set_visible(False) + wedges[-2].set_visible(False) + ax.set_ylim(-0.0, 1.0) - wedges, texts = ax.pie(data[0], wedgeprops=dict(width=0.5), startangle=-40, colors=palette_color) + legend_labels = [f"{data[0][i]:3.2f} ms - {data[1][i]}" for i in range(len(data[0])) if data[1][i] != "NULL"] + lax.legend(wedges, legend_labels, borderaxespad=0, loc="upper center") + lax.set_ylim(0.0, 0.25) + lax.axis("off") - bbox_props = dict(boxstyle="square,pad=0.3", fc="w", ec="k", lw=0.72) - kw = dict(arrowprops=dict(arrowstyle="-"), bbox=bbox_props, zorder=0, va="center") + plt.tight_layout() - for i, p in enumerate(wedges): - ang = (p.theta2 - p.theta1)/2. + p.theta1 - y = np.sin(np.deg2rad(ang)) - x = np.cos(np.deg2rad(ang)) - horizontalalignment = {-1: "right", 1: "left"}[int(np.sign(x))] - connectionstyle = f"angle,angleA=0,angleB={ang}" - kw["arrowprops"].update({"connectionstyle": connectionstyle}) - ax.annotate(f"{data[1][i]} - {data[0][i]:2.2f} ms", xy=(x, y), xytext=(1.35*np.sign(x), 1.4*y), horizontalalignment=horizontalalignment, **kw) - - plt.rcParams.update({'font.size': 18}) + plt.rcParams.update({'font.size': 16}) fig.savefig(os.path.join(output_path, fname), bbox_inches='tight') def main(): - donut_plot(read_timings_from_csv(prefetch_result), "plot-timing-prefetch.pdf") - donut_plot(read_timings_from_csv(distprefetch_result), "plot-timing-distprefetch.pdf") - donut_plot(read_timings_from_csv(dram_result), "plot-timing-dram.pdf") - donut_plot(read_timings_from_csv(hbm_result), "plot-timing-hbm.pdf") - donut_plot(read_timings_from_csv(prefetch_result), "plot-timing-prefetch.pdf") + timings = [ + read_timings_from_csv(prefetch_result, fn_nice_prefetch), + read_timings_from_csv(distprefetch_result, fn_nice_prefetch), + read_timings_from_csv(dram_result, fn_nice_normal), + read_timings_from_csv(hbm_result, fn_nice_normal) + ] + + maxtime = max([sum(timings[0][0]), sum(timings[1][0]), sum(timings[2][0]), sum(timings[3][0])]) + + donut_plot(timings[0], maxtime, "plot-timing-prefetch.pdf") + donut_plot(timings[1], maxtime, "plot-timing-distprefetch.pdf") + donut_plot(timings[2], maxtime, "plot-timing-dram.pdf") + donut_plot(timings[3], maxtime, "plot-timing-hbm.pdf") + donut_plot(read_timings_from_csv(prefetch_result, fn_nice_prefetch), maxtime, "plot-timing-prefetch.pdf") + tex_table(generate_speedup_table(), "table-qdp-speedup.tex") tex_table(generate_rawtime_base_table(), "table-qdp-baseline.tex") diff --git a/thesis/images/plot-timing-distprefetch.pdf b/thesis/images/plot-timing-distprefetch.pdf index ae840ca..c99f9c1 100644 Binary files a/thesis/images/plot-timing-distprefetch.pdf and b/thesis/images/plot-timing-distprefetch.pdf differ diff --git a/thesis/images/plot-timing-dram.pdf b/thesis/images/plot-timing-dram.pdf index e575ed9..ffa15e9 100644 Binary files a/thesis/images/plot-timing-dram.pdf and b/thesis/images/plot-timing-dram.pdf differ diff --git a/thesis/images/plot-timing-hbm.pdf b/thesis/images/plot-timing-hbm.pdf index 2d4dcc3..198429c 100644 Binary files a/thesis/images/plot-timing-hbm.pdf and b/thesis/images/plot-timing-hbm.pdf differ diff --git a/thesis/images/plot-timing-prefetch.pdf b/thesis/images/plot-timing-prefetch.pdf index 57a3662..f45d332 100644 Binary files a/thesis/images/plot-timing-prefetch.pdf and b/thesis/images/plot-timing-prefetch.pdf differ