From 70d464b53602d4b4f22e7256aba0bc12d7addd8f Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 23 Jan 2020 18:14:11 +0100 Subject: generate an example pgfplot for the loop benchmark --- src/benchmarks/loop.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/benchmarks/loop.py') diff --git a/src/benchmarks/loop.py b/src/benchmarks/loop.py index 4ab7d46..b0c3929 100644 --- a/src/benchmarks/loop.py +++ b/src/benchmarks/loop.py @@ -85,5 +85,13 @@ class BenchmarkLoop(Benchmark): self.export_stats_to_csv("task-clock") self.export_stats_to_dataref("task-clock") + # pgfplot test + self.pgfplot_linear(self.iterate_args_fixed({"maxsize": 1024}, args=self.results["args"]), + "int(perm.nthreads)", + "perm.nthreads / ({task-clock}/1000)", + xlabel='"Threads"', + ylabel='"MOPS/cpu-second"', + title='"Loop: 1024B"', + postfix='mops_1024B') loop = BenchmarkLoop() -- cgit v1.2.3 From 9e2d7eb1cb952b398bd7363ab95ea9f1d4598ab1 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 11 Feb 2020 12:38:00 +0100 Subject: implement standalone pgfplot legend creation --- src/benchmarks/loop.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/benchmarks/loop.py') diff --git a/src/benchmarks/loop.py b/src/benchmarks/loop.py index b0c3929..a969f4a 100644 --- a/src/benchmarks/loop.py +++ b/src/benchmarks/loop.py @@ -94,4 +94,7 @@ class BenchmarkLoop(Benchmark): title='"Loop: 1024B"', postfix='mops_1024B') + # create pgfplot legend + self.pgfplot_legend() + loop = BenchmarkLoop() -- cgit v1.2.3 From 60b860ce3619d5f165bf8eda6ad596d5d458d1e2 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 11 Feb 2020 13:23:55 +0100 Subject: move plotting code from src.benchmark to src.plots --- src/benchmarks/loop.py | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) (limited to 'src/benchmarks/loop.py') diff --git a/src/benchmarks/loop.py b/src/benchmarks/loop.py index a969f4a..75c56ee 100644 --- a/src/benchmarks/loop.py +++ b/src/benchmarks/loop.py @@ -35,6 +35,7 @@ Interpretation: """ from src.benchmark import Benchmark +import src.plots as plt class BenchmarkLoop(Benchmark): @@ -57,14 +58,16 @@ class BenchmarkLoop(Benchmark): def summary(self): # Speed - self.plot_fixed_arg("perm.nthreads / ({task-clock}/1000)", - ylabel='"MOPS/cpu-second"', - title='"Loop: " + arg + " " + str(arg_value)', - filepostfix="time", - autoticks=False) + plt.plot_fixed_arg(self, + "perm.nthreads / ({task-clock}/1000)", + ylabel='"MOPS/cpu-second"', + title='"Loop: " + arg + " " + str(arg_value)', + filepostfix="time", + autoticks=False) # L1 cache misses - self.plot_fixed_arg( + plt.plot_fixed_arg( + self, "({L1-dcache-load-misses}/{L1-dcache-loads})*100", ylabel='"L1 misses in %"', title='"Loop l1 cache misses: " + arg + " " + str(arg_value)', @@ -72,29 +75,34 @@ class BenchmarkLoop(Benchmark): autoticks=False) # Speed Matrix - self.write_best_doublearg_tex_table( - "perm.nthreads / ({task-clock}/1000)", filepostfix="time.matrix") + plt.write_best_doublearg_tex_table( + self, + "perm.nthreads / ({task-clock}/1000)", + filepostfix="time.matrix") - self.write_tex_table([{ + plt.write_tex_table(self, [{ "label": "MOPS/s", "expression": "perm.nthreads / ({task-clock}/1000)", "sort": ">" }], - filepostfix="mops.table") + filepostfix="mops.table") - self.export_stats_to_csv("task-clock") - self.export_stats_to_dataref("task-clock") + plt.export_stats_to_csv(self, "task-clock") + plt.export_stats_to_dataref(self, "task-clock") # pgfplot test - self.pgfplot_linear(self.iterate_args_fixed({"maxsize": 1024}, args=self.results["args"]), - "int(perm.nthreads)", - "perm.nthreads / ({task-clock}/1000)", - xlabel='"Threads"', - ylabel='"MOPS/cpu-second"', - title='"Loop: 1024B"', - postfix='mops_1024B') + plt.pgfplot_linear(self, + self.iterate_args_fixed({"maxsize": 1024}, + args=self.results["args"]), + "int(perm.nthreads)", + "perm.nthreads / ({task-clock}/1000)", + xlabel='"Threads"', + ylabel='"MOPS/cpu-second"', + title='"Loop: 1024B"', + postfix='mops_1024B') # create pgfplot legend - self.pgfplot_legend() + plt.pgfplot_legend(self) + loop = BenchmarkLoop() -- cgit v1.2.3 From e27ec8f7d77d155dbc77718bfb40dce7b1ae6859 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 11 Feb 2020 15:05:37 +0100 Subject: replace eval with str.format labels in loop.py --- src/benchmarks/loop.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/benchmarks/loop.py') diff --git a/src/benchmarks/loop.py b/src/benchmarks/loop.py index 75c56ee..ec520a4 100644 --- a/src/benchmarks/loop.py +++ b/src/benchmarks/loop.py @@ -60,8 +60,8 @@ class BenchmarkLoop(Benchmark): # Speed plt.plot_fixed_arg(self, "perm.nthreads / ({task-clock}/1000)", - ylabel='"MOPS/cpu-second"', - title='"Loop: " + arg + " " + str(arg_value)', + ylabel="MOPS/cpu-second", + title="Loop: {arg} {arg_value}", filepostfix="time", autoticks=False) @@ -69,8 +69,8 @@ class BenchmarkLoop(Benchmark): plt.plot_fixed_arg( self, "({L1-dcache-load-misses}/{L1-dcache-loads})*100", - ylabel='"L1 misses in %"', - title='"Loop l1 cache misses: " + arg + " " + str(arg_value)', + ylabel="L1 misses in %", + title="Loop l1 cache misses: {arg} {arg_value}", filepostfix="l1misses", autoticks=False) @@ -96,9 +96,9 @@ class BenchmarkLoop(Benchmark): args=self.results["args"]), "int(perm.nthreads)", "perm.nthreads / ({task-clock}/1000)", - xlabel='"Threads"', - ylabel='"MOPS/cpu-second"', - title='"Loop: 1024B"', + xlabel="Threads", + ylabel="MOPS/cpu-second", + title="Loop: 1024B", postfix='mops_1024B') # create pgfplot legend -- cgit v1.2.3