aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/benchmark.py23
-rwxr-xr-xsummarize.py4
2 files changed, 23 insertions, 4 deletions
diff --git a/src/benchmark.py b/src/benchmark.py
index 15c4fee..cbc59eb 100644
--- a/src/benchmark.py
+++ b/src/benchmark.py
@@ -612,7 +612,12 @@ class Benchmark:
plt.xlabel(eval(xlabel))
plt.ylabel(eval(ylabel))
plt.title(eval(title))
- plt.savefig(os.path.join(sumdir, ".".join([self.name, filepostfix, file_ext])))
+ figname = os.path.join(sumdir, f"{self.name}.{filepostfix}.{file_ext}")
+ if figname.endswith(".tex"):
+ import tikzplotlib
+ tikzplotlib.save(figname)
+ else:
+ plt.savefig(figname)
plt.clf()
def barplot_single_arg(self, yval, ylabel="'y-label'", xlabel="'x-label'",
@@ -661,7 +666,12 @@ class Benchmark:
plt.xlabel(eval(xlabel))
plt.ylabel(eval(ylabel))
plt.title(eval(title))
- plt.savefig(os.path.join(sumdir, ".".join([self.name, filepostfix, file_ext])))
+ figname = os.path.join(sumdir, f"{self.name}.{filepostfix}.{file_ext}")
+ if figname.endswith(".tex"):
+ import tikzplotlib
+ tikzplotlib.save(figname)
+ else:
+ plt.savefig(figname)
plt.clf()
def plot_fixed_arg(self, yval, ylabel="'y-label'", xlabel="loose_arg",
@@ -702,8 +712,13 @@ class Benchmark:
plt.xlabel(eval(xlabel))
plt.ylabel(eval(ylabel))
plt.title(eval(title))
- plt.savefig(os.path.join(sumdir,
- f"{self.name}.{arg}.{arg_value}.{filepostfix}.{file_ext}"))
+ figname = os.path.join(sumdir,
+ f"{self.name}.{arg}.{arg_value}.{filepostfix}.{file_ext}")
+ if figname.endswith(".tex"):
+ import tikzplotlib
+ tikzplotlib.save(figname)
+ else:
+ plt.savefig(figname)
plt.clf()
def export_facts_to_file(self, comment_symbol, f):
diff --git a/summarize.py b/summarize.py
index dab2742..6681137 100755
--- a/summarize.py
+++ b/summarize.py
@@ -99,6 +99,7 @@ def main():
parser = argparse.ArgumentParser(description="Summarize allocbench results in allocator sets")
parser.add_argument("results", help="path to results", type=str)
+ parser.add_argument("-t", "--file-ext", help="file extension used for plots", type=str)
parser.add_argument("--license", help="print license info and exit", action='store_true')
parser.add_argument("--version", help="print version info and exit", action='store_true')
parser.add_argument("-b", "--benchmarks", help="benchmarks to summarize", nargs='+')
@@ -110,6 +111,9 @@ def main():
print_error(f"{args.results} is no directory")
exit(1)
+ if args.file_ext:
+ src.globalvars.summary_file_ext = args.file_ext
+
src.globalvars.resdir = args.results
os.chdir(args.results)