Skip to content
Snippets Groups Projects
Commit 4548ad4d authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Add a plotting script

parent 8738c36b
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import pandas
import matplotlib.pyplot as plt
import sys
title = sys.argv[1]
filename = title.lower().replace(" ", "_") + ".pdf"
flopframe = pandas.read_csv("./poissondg-insn2/floprates.csv", header=None, delimiter=" ", names=("exec", "degree", "what", "GFlops"))
flopframe = flopframe[flopframe.what == "residual_evaluation"]
timeframe = pandas.read_csv("./poissondg-insn2/doftimes.csv", header=None, delimiter=" ", names=("exec", "degree", "what", "DOFs"))
timeframe = timeframe[timeframe.what == "residual_evaluation"]
fig, ax1 = plt.subplots()
ax2 = ax1.twinx()
ax1.plot(frame['degree'], flopframe['GFlops'])
ax2.plot(frame['degree'], timeframe['DOFs'])
ax1.set_xlabel("Polynomial degree")
ax1.set_ylabel("GFlops")
ax2.set_ylabel("DOFs / s")
plt.title(title)
plt.savefig(filename)
......@@ -27,7 +27,8 @@ def calculate_floprate():
exe, kernel = key
if "nonopcount" in exe and kernel != "total":
opexe = exe.replace("nonopcount", "opcount")
out.write(" ".join([exe, kernel, str((ops[opexe][kernel] / time[exe][kernel]) / 1e9)]) + "\n")
degree = re.match(".*deg([0-9]*).*", exe).group(1)
out.write(" ".join([exe, degree, kernel, str((ops[opexe][kernel] / time[exe][kernel]) / 1e9)]) + "\n")
def calculate_doftimes():
......@@ -41,8 +42,9 @@ def calculate_doftimes():
with open('doftimes.csv', 'w') as out:
for key in time.keys():
exe, kernel = key
degree = re.match(".*deg([0-9]*).*", exe).group(1)
if "nonopcount" in exe:
out.write(" ".join([exe, kernel, str(dofs[exe]["dofs"] / time[exe][kernel] / 1e6)]) + "\n")
out.write(" ".join([exe, degree, kernel, str(dofs[exe]["dofs"] / time[exe][kernel] / 1e6)]) + "\n")
if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment