52 parser = argparse.ArgumentParser(
53 description=
"ExaHyPE 2 - Finite Volume Riemann Kernel Benchmark Throughput Plotting Script"
55 parser.add_argument(dest=
"file", help=
"File to parse")
61 help=
"Scale axes to log-log",
67 choices=OutputFormats,
68 default=output_format,
69 help=
"|".join(OutputFormats),
71 args = parser.parse_args()
74 print(
"create plot for {}".format(args.file))
77 number_of_patches =
"xxx"
78 number_of_launching_threads =
"xxx"
79 number_of_compute_threads =
"xxx"
81 for device
in Devices:
82 for call_semantics
in CallSemantics:
83 for data_flow
in DataFlow:
87 number_of_launching_threads,
88 number_of_compute_threads,
91 assert len(throughput_total) == len(
93 ),
"data cardinalities {} vs {}".format(
94 len(throughput_total), len(throughput_kernel)
96 if len(throughput_total) > 0:
98 "data found for {}, {}, {}".format(
99 device, call_semantics, data_flow
104 max_throughput_kernel_label = max(
105 throughput_kernel, key=
lambda k: throughput_kernel[k]
108 max_throughput_kernel_value = throughput_kernel[
109 max_throughput_kernel_label
113 max_throughput_total_label = max(
114 throughput_total, key=
lambda k: throughput_total[k]
117 max_throughput_total_value = throughput_total[
118 max_throughput_total_label
122 max_throughput_kernel_value,
123 max_throughput_total_value,
124 c=Colours[marker_counter % len(Colours)],
125 marker=Markers[marker_counter % len(Markers)],
132 + max_throughput_kernel_label
134 + max_throughput_total_label
139 plt.title(
"Measured throughput - higher is better; only best case labels are shown")
140 plt.legend(bbox_to_anchor=(1.05, 1), loc=
"upper left")
141 plt.xlabel(
"Throughput for one kernel (volume updates/s)")
142 plt.ylabel(
"Total throughput (volume updates/s)")
144 f
"number of patches: {number_of_patches}",
146 xycoords=
"axes fraction",
150 f
"number of launching threads: {number_of_launching_threads}",
152 xycoords=
"axes fraction",
156 f
"number of compute threads: {number_of_compute_threads}",
158 xycoords=
"axes fraction",
161 plt.grid(color=
"grey", alpha=0.5, linestyle=
"dashed", linewidth=0.5)
167 if args.output_format ==
"pgf":
169 canvas = FigureCanvasPgf(fig)
170 canvas.print_figure(args.file +
".pgf", bbox_inches=
"tight")
172 plt.savefig(args.file +
"." + args.output_format, bbox_inches=
"tight")
200 Search for entries for particular argument combination
201 We return two lists: The first one gives the throughput for one compute kernel
202 while the second one gives the total throughput per measurement including kernel
205 throughput_kernel = {}
206 throughput_total = {}
207 number_of_patches =
"xxx"
208 number_of_launching_threads =
"xxx"
209 number_of_compute_threads =
"xxx"
211 for line
in data_lines:
212 if "number of threads launching compute kernels" in line:
213 number_of_launching_threads = line.split(
":")[-1].strip()
214 if "number of compute threads" in line:
215 number_of_compute_threads = line.split(
":")[-1].strip()
216 if "number of patches" in line:
217 number_of_patches = line.split(
":")[-1].strip()
218 if device
in line
and call_semantics
in line
and data_flow
in line:
219 memory_layout = line.split(
",")[3]
220 parallelisation = line.split(
",")[4].split(
":")[0]
221 current_throughput_kernel = 1.0 / float(line.split(
"|")[1])
222 current_throughput_total = 1.0 / float(line.split(
"|")[4])
224 memory_layout +
", " + parallelisation
225 ] = current_throughput_kernel
227 memory_layout +
", " + parallelisation
228 ] = current_throughput_total
232 number_of_launching_threads,
233 number_of_compute_threads,