From 236b06a88f709ca6c70ce0c7adfb57f9f0b2a60d Mon Sep 17 00:00:00 2001 From: Thibaut Horel Date: Wed, 11 May 2016 22:03:53 -0400 Subject: Add final code used during experiments --- main.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 main.py (limited to 'main.py') diff --git a/main.py b/main.py new file mode 100644 index 0000000..c37c288 --- /dev/null +++ b/main.py @@ -0,0 +1,36 @@ +import numpy as np +import matplotlib.pyplot as plt +import seaborn +import matplotlib + +seaborn.set_style("white") + +matplotlib.rcParams.update({'xtick.labelsize': 12}) +matplotlib.rcParams.update({'ytick.labelsize': 12}) +matplotlib.rcParams.update({'legend.fontsize': 12}) +matplotlib.rcParams.update({'axes.titlesize': 12}) +matplotlib.rcParams.update({'axes.labelsize': 12}) + +with open("time.txt") as fh: + values = [line.split() for line in fh] + +h, post, bfs = zip(*values) +plt.plot(h, post, label="DF") +plt.plot(h, bfs, label="BF") +plt.legend() +plt.xlabel("height") +plt.ylabel("runtime (s)") +plt.savefig("time.pdf", bbox_inches='tight') + +plt.clf() +with open("misses.txt") as fh: + values = [line.split() for line in fh] +h, bfs, post = zip(*values) +plt.plot(h, post, label="DF") +plt.plot(h, bfs, label="BF") +plt.legend() +plt.xlabel("height") +plt.ylabel("cache-misses") +plt.savefig("misses.pdf", bbox_inches='tight') + +print h, post, bfs -- cgit v1.2.3-70-g09d2