aboutsummaryrefslogtreecommitdiff
path: root/loop.py
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2018-09-14 20:21:56 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2018-09-14 20:21:56 +0200
commitb82099483c78acf8245a1c6be94b546b64d483d8 (patch)
treef8300ed31fee2ae4bd0c702e4aa802d02ac59a2d /loop.py
parentede9aaa8d602aae204df5eacba3aae73b3a352b1 (diff)
downloadallocbench-b82099483c78acf8245a1c6be94b546b64d483d8.tar.gz
allocbench-b82099483c78acf8245a1c6be94b546b64d483d8.zip
fix perf parsing and add new plot functions and use them
Diffstat (limited to 'loop.py')
-rw-r--r--loop.py63
1 files changed, 11 insertions, 52 deletions
diff --git a/loop.py b/loop.py
index e22933b..f3ae578 100644
--- a/loop.py
+++ b/loop.py
@@ -22,63 +22,22 @@ class Benchmark_Loop( Benchmark ):
self.requirements = ["build/bench_loop"]
super().__init__()
- def summary(self, sd=None):
+ def summary(self, sumdir):
args = self.results["args"]
targets = self.results["targets"]
- sd = sd or ""
-
# Speed
- for arg in args:
- loose_arg = [a for a in args if a != arg][0]
- for arg_value in args[arg]:
- for target in targets:
- y_vals = []
- for perm in self.iterate_args_fixed({arg : arg_value}, args=args):
- d = []
- for measure in self.results[target][perm]:
- # nthreads/time = MOPS/s
- for e in measure:
- if "task-clock" in e:
- d.append(perm.nthreads/float(measure[e]))
- y_vals.append(np.mean(d))
-
- x_vals = list(range(1, len(y_vals) + 1))
-
- plt.plot(x_vals, y_vals, marker='.', linestyle='-',
- label=target, color=targets[target]["color"])
-
- plt.legend()
- plt.xticks(x_vals, args[loose_arg])
- plt.xlabel(loose_arg)
- plt.ylabel("MOPS/s")
- plt.title("Loop: " + arg + " " + str(arg_value))
- plt.savefig(os.path.join(sd, ".".join([self.name, arg, str(arg_value), "png"])))
- plt.clf()
+ self.plot_fixed_arg("perm.nthreads / float({task-clock})",
+ ylabel = '"MOPS/s"',
+ title = '"Loop: " + arg + " " + str(arg_value)',
+ filepostfix="tclock",
+ sumdir=sumdir)
# Memusage
- for arg in args:
- loose_arg = [a for a in args if a != arg][0]
- for arg_value in args[arg]:
- for target in targets:
- y_vals = []
- for perm in self.iterate_args_fixed({arg : arg_value}, args=args):
- d = []
- for measure in self.results[target][perm]:
- d.append(int(measure["VmHWM"]))
- y_vals.append(np.mean(d))
-
- x_vals = list(range(1, len(y_vals) + 1))
-
- plt.plot(x_vals, y_vals, marker='.', linestyle='-',
- label=target, color=targets[target]["color"])
-
- plt.legend()
- plt.xticks(x_vals, args[loose_arg])
- plt.xlabel(loose_arg)
- plt.ylabel("VmHWM")
- plt.title("Loop Memusage: " + arg + " " + str(arg_value))
- plt.savefig(os.path.join(sd, ".".join([self.name, arg, str(arg_value), "mem", "png"])))
- plt.clf()
+ self.plot_fixed_arg("int({VmHWM})",
+ ylabel='"VmHWM in kB"',
+ title= '"Loop Memusage: " + arg + " " + str(arg_value)',
+ filepostfix="memusage",
+ sumdir=sumdir)
loop = Benchmark_Loop()