aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2019-06-19 11:50:31 +0200
committerCyril SIX <cyril.six@kalray.eu>2019-06-19 11:52:10 +0200
commite4e4bb635650055a94112250b71c111096f1263e (patch)
tree3b0ead3d3bdc5eb9b5b97da2b592b2079fe6ac59
parent7da5e4590233ef631074e0aeacfc9e7810a00f1d (diff)
downloadcompcert-kvx-e4e4bb635650055a94112250b71c111096f1263e.tar.gz
compcert-kvx-e4e4bb635650055a94112250b71c111096f1263e.zip
Makefile in test/monniaux that generates the compilation time graphs
-rw-r--r--test/monniaux/Asmblockdeps.patch (renamed from Asmblockdeps.patch)0
-rw-r--r--test/monniaux/PostpassSchedulingOracle.patch (renamed from PostpassSchedulingOracle.patch)0
-rwxr-xr-xtest/monniaux/build_benches.sh15
-rwxr-xr-xtest/monniaux/gencompile.py70
4 files changed, 37 insertions, 48 deletions
diff --git a/Asmblockdeps.patch b/test/monniaux/Asmblockdeps.patch
index a2d8c7be..a2d8c7be 100644
--- a/Asmblockdeps.patch
+++ b/test/monniaux/Asmblockdeps.patch
diff --git a/PostpassSchedulingOracle.patch b/test/monniaux/PostpassSchedulingOracle.patch
index 71c44350..71c44350 100644
--- a/PostpassSchedulingOracle.patch
+++ b/test/monniaux/PostpassSchedulingOracle.patch
diff --git a/test/monniaux/build_benches.sh b/test/monniaux/build_benches.sh
index 123f4c82..a8f1b1a5 100755
--- a/test/monniaux/build_benches.sh
+++ b/test/monniaux/build_benches.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/bash
+
TMPFILE=/tmp/1513times.txt
source benches.sh
@@ -5,9 +7,14 @@ source benches.sh
rm -f commands.txt
rm -f $TMPFILE
for bench in $benches; do
- #echo "(cd $bench && make -j5 $1)" >> commands.txt
- (cd $bench && make -j20 $1) | grep -P "\d+: \d+\.\d+" >> $TMPFILE
+ if [ "$1" == "" ]; then
+ (cd $bench && make -j20)
+ else
+ (cd $bench && make -j20) | grep -P "\d+: \d+\.\d+" >> $TMPFILE
+ fi
done
-cat $TMPFILE | sort -n -k 1 > compile_times.txt
-#cat commands.txt | xargs -n1 -I{} -P4 bash -c '{}'
+if [ "$1" != "" ]; then
+ cat $TMPFILE | sort -n -k 1 > $1
+fi
+
diff --git a/test/monniaux/gencompile.py b/test/monniaux/gencompile.py
index faa7bdd8..789bd4fa 100755
--- a/test/monniaux/gencompile.py
+++ b/test/monniaux/gencompile.py
@@ -9,58 +9,40 @@ from typing import *
# Reading data
##
-if len(sys.argv) != 2:
- raise Exception("Only 1 argument should be given to this script: the file with the compile times")
-data_file = sys.argv[1]
+if len(sys.argv) != 4:
+ raise Exception("Three arguments are expected: the verifier times, the oracle times, and the output PDF")
+_, verifier_file, oracle_file, output_file = sys.argv
-coords: List[Tuple[int, float]] = []
-with open(data_file, "r") as f:
- for line in f:
- nb_inst_s, time_s = line.split(":")
- coords.append((int(nb_inst_s), float(time_s)))
+def get_coords(filename: str) -> List[Tuple[int, float]]:
+ coords = []
+ with open(filename, "r") as f:
+ for line in f:
+ nb_inst_s, time_s = line.split(":")
+ coords.append((int(nb_inst_s), float(time_s)))
+ return coords
+
+verifier_coords = get_coords(verifier_file)
+oracle_coords = get_coords(oracle_file)
##
# Generating PDF
##
fig, ax = plt.subplots()
-x = [coord[0] for coord in coords]
-y = [coord[1] for coord in coords]
-plt.plot(x, y, "b+")
-ax.set_ylabel("Time x1000 (s)")
-ax.set_title("Verification time")
-ax.set_xlabel("Size of basic blocks")
+def do_plot(coords: List[Tuple[int, float]], style: str, label: str):
+ x = [coord[0] for coord in coords]
+ y = [coord[1] for coord in coords]
+ plt.plot(x, y, style, label=label)
-plt.savefig("compile-times.pdf")
+plt.xscale("log")
+plt.yscale("log")
+do_plot(verifier_coords, "b+", "Verifier")
+do_plot(oracle_coords, "g+", "Oracle")
+ax.set_ylabel("Time x1000 (s)")
+ax.set_title("Compilation time")
+ax.set_xlabel("Size of basic blocks")
+ax.legend()
-#def generate_file(f: str, cols: List[str]) -> None:
-# ind = np.arange(len(df[cols[0]]))
-#
-# width = 0.25 # the width of the bars
-#
-# compilers = extract_compilers(cols)
-# start_inds = subdivide_interv(ind, ind+2*width, len(compilers))
-# heights: Dict[str, List[float]] = make_relative_heights(df, cols)
-#
-# fig, ax = plt.subplots()
-# rects = []
-# for i, compiler in enumerate(compilers):
-# rects.append(ax.bar(start_inds[i], heights[compiler], width, color=colors[i], label=compiler))
-#
-# # Add some text for labels, title and custom x-axis tick labels, etc.
-# ax.set_ylabel('Cycles (%)')
-# ax.set_yticklabels(['{:,.0%}'.format(x) for x in ax.get_yticks()])
-# ax.set_title('TITLE')
-# ax.set_xticks(ind)
-# ax.set_xticklabels(benches)
-# ax.legend()
-#
-# plt.setp(ax.get_xticklabels(), rotation=30, horizontalalignment='right')
-# plt.xticks(size=5)
-#
-# plt.savefig(f)
-#
-#generate_file("measures-host.pdf", host_measures_cols)
-#generate_file("measures-k1c.pdf", k1c_measures_cols)
+plt.savefig(output_file)