22 parser = argparse.ArgumentParser(
23 description=
"ExaHyPE 2 - Finite Volume Riemann Kernel Benchmark Throughput Plotting Script"
25 parser.add_argument(dest=
"file", help=
"File to parse")
26 args = parser.parse_args()
29 print(
"Create throughput plot for {}".format(args.file))
32 kernel_throughputs = []
35 for device
in [
"host",
"device"]:
37 label = device + line.split(device)[-1].split(
":")[0]
38 throughput = 1.0 / float(line.split(device)[-1].split(
":")[1].split(
"|")[1])
39 kernel_labels.append(label)
40 kernel_throughputs.append(throughput)
41 print(
"data found for {}".format(label))
44 fig, ax = plt.subplots(figsize=(20, 6))
46 colors = plt.cm.viridis(np.linspace(0, 1, len(kernel_throughputs)))
58 bar.set_edgecolor(
'black')
59 bar.set_linewidth(1.2)
63 plt.grid(axis=
"y", linestyle=
"--", alpha=0.7, linewidth=0.7, zorder=1)
65 plt.ylabel(
"Volume updates per second", fontsize=15)
67 ax.set_facecolor(
'#d3d3d3')
69 ax.yaxis.set_major_formatter(ScalarFormatter(useMathText=
True))
70 ax.ticklabel_format(axis=
"y", style=
"sci", scilimits=(0, 0))
71 ax.yaxis.get_offset_text().set_fontsize(15)
73 ax.tick_params(axis=
'both', which=
'major', labelsize=15)
75 ax.set_xticks(range(len(kernel_labels)))
76 ax.set_xticklabels(kernel_labels, fontsize=15)
78 plt.xticks(fontsize=15)
79 plt.yticks(fontsize=15)
81 plt.savefig(args.file +
".png", bbox_inches=
"tight", transparent=
False)
82 plt.savefig(args.file +
".pdf", bbox_inches=
"tight", transparent=
False)
84 fig.patch.set_alpha(0)
85 canvas = FigureCanvasPgf(fig)
86 canvas.print_figure(args.file +
".pgf", bbox_inches=
"tight",)