12 import matplotlib.pyplot
as plt
15 def fFileExist(filename):
16 """Test if file exists"""
19 oFile = open(filename)
27 def read(optlevel, b, name):
28 """read time from out/*.out and save plots to plots/. The cut deletes obviously wrong times."""
31 for i
in range(0, len(optlevel)):
32 if fFileExist(
"out/" + optlevel[i - z] +
".out") == 0:
36 value = [0] * len(optlevel)
37 sigma = [0] * len(optlevel)
38 valuenormed = [0] * len(optlevel)
39 sigmanormed = [0] * len(optlevel)
40 n = [0] * len(optlevel)
41 t = list(range(0, len(optlevel)))
43 fobj = open(
"out/" + optlevel[i] +
".out")
48 readvalue.append(1 / float(words[b]))
51 value[i] = np.mean(readvalue)
52 sigma[i] = np.std(readvalue)
53 u = list(range(0, len(readvalue)))
57 if readvalue[j - z] > 1.5 * value[i]
or readvalue[j - z] < 0.5 * value[i]:
60 sigma[i] = np.std(readvalue)
61 value[i] = np.mean(readvalue)
64 for i
in range(0, len(value)):
65 valuenormed[i] = value[i] * x
66 sigmanormed[i] = sigma[i] * x
77 (locs, labels) = plt.xticks(t, optlevel)
78 plt.setp(labels, rotation=90)
79 plt.xlim([-0.5, len(optlevel) - 0.5])
80 plt.ylabel(
"performance")
82 fig.subplots_adjust(bottom=0.65)
83 plt.savefig(
"plots/" + name +
".png")
85 fobj = open(
"plots/" + name +
".out",
"w")
92 + str(
"%.3f" % value[i])
94 + str(
"%.3f" % sigma[i])
96 + str(
"%.4f" % valuenormed[i])
98 + str(
"%.4f" % sigmanormed[i])
101 fobj.write(
r"\hline\n")
104 name =
"CDCLegendreTracking"
105 optlevel = [
"gcc-O0",
"gcc-O3",
"gcc-O3-native"]
106 read(optlevel, 0, name)