Skip to content

Commit dfc6bd0

Browse files
committed
Script to run SVCOMP17 benchmarks
1 parent ffb1ce3 commit dfc6bd0

File tree

1 file changed

+208
-0
lines changed

1 file changed

+208
-0
lines changed

experiments/svcomp17/runsvcomp17.sh

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
#!/bin/bash
2+
3+
# 1s = 1 second; 2m = 2 minutes; 3h = 3 hours
4+
TIMEOUT=8m
5+
6+
WANT_DPU_ALT_SDPOR=n
7+
WANT_DPU_ALT0=n
8+
WANT_DPU_ALT1=n
9+
WANT_DPU_ALT2=y
10+
WANT_DPU_ALT3=n
11+
WANT_DPU_ALT4=n
12+
WANT_NIDHUGG=y
13+
14+
DPU_OPTS="-O1"
15+
NIDHUGG_OPTS=
16+
17+
source ../cav18/runlib.sh
18+
19+
runall_dpu ()
20+
{
21+
# pre-conditions:
22+
# $TIMEOUT - a timeout specification valid for timeout(1)
23+
# $DPU - path to the dpu tool to run
24+
25+
OPTS="--mem 128M --stack 1M $DPU_OPTS"
26+
for i in */*.c; do
27+
N=`echo "$i" | sed s/.c$//`
28+
29+
if test $WANT_DPU_ALT_SDPOR = y; then
30+
# -k-1
31+
LOG=${N}_dpu_alt-1.txt
32+
CMD="$DPU $i -k-1 $OPTS"
33+
run_dpu
34+
fi
35+
36+
if test $WANT_DPU_ALT0 = y; then
37+
# -k0
38+
LOG=${N}_dpu_alt0.txt
39+
CMD="$DPU $i -k0 $OPTS"
40+
run_dpu
41+
42+
# if we got TO on -k0, surely we will also get it on -kX with X!=0
43+
if test "$WALLTIME" == "TO"; then continue; fi
44+
fi
45+
46+
# k-partial
47+
for a in 1 2 3 4; do
48+
case $a in
49+
1) if test $WANT_DPU_ALT1 = n; then continue; fi;;
50+
2) if test $WANT_DPU_ALT2 = n; then continue; fi;;
51+
3) if test $WANT_DPU_ALT3 = n; then continue; fi;;
52+
4) if test $WANT_DPU_ALT4 = n; then continue; fi;;
53+
esac
54+
LOG=${N}_dpu_alt${a}.txt
55+
CMD="$DPU $i -k$a $OPTS"
56+
run_dpu
57+
58+
# if we got 0 SSBs we skip higher -k
59+
if test "$SSBS" = 0; then break; fi
60+
done
61+
done
62+
}
63+
64+
runall_nidhugg ()
65+
{
66+
# pre-conditions:
67+
# $TIMEOUT - a timeout specification valid for timeout(1)
68+
# $NIDHUGG - path to the nidhugg tool to run
69+
70+
if test $WANT_NIDHUGG = n; then return 0; fi
71+
72+
OPTS="--c -sc
73+
-disable-mutex-init-requirement
74+
-extfun-no-race=printf
75+
-extfun-no-race=fprintf
76+
-extfun-no-race=write
77+
-extfun-no-race=exit
78+
-extfun-no-race=atoi
79+
-extfun-no-race=pow
80+
"
81+
OPTS=$(echo $OPTS) # remove newline characters
82+
83+
for i in */*.c; do
84+
echo $N
85+
N=`echo "$i" | sed s/.c$//`
86+
LOG=${N}_nidhugg.txt
87+
CMD="$NIDHUGG $OPTS $i"
88+
run_nidhugg
89+
done
90+
}
91+
92+
generate_bench_selection ()
93+
{
94+
cp -R $R/pthread .
95+
96+
echo Benchmarks:
97+
ls -l */*.c
98+
echo
99+
}
100+
101+
dry_run ()
102+
{
103+
h2 "Dry running the tools"
104+
105+
echo Running '``'$DPU --help'``'::
106+
echo
107+
$DPU --help 2>&1 | quote
108+
109+
echo
110+
echo Running '``'$DPU --version'``'::
111+
echo
112+
$DPU --version 2>&1 | quote
113+
114+
echo
115+
echo Running '``'$NIDHUGG --help'``'::
116+
echo
117+
$NIDHUGG --help 2>&1 | quote
118+
119+
echo
120+
echo Running '``'$NIDHUGG --version'``'::
121+
echo
122+
$NIDHUGG --version 2>&1 | quote
123+
124+
echo
125+
echo Running '``'clang-3.4 --version'`` (required by nidhugg)::'
126+
echo
127+
clang-3.4 --version 2>&1 | quote
128+
129+
echo
130+
echo **WARNING**:
131+
echo If you see error messages above this line,
132+
echo then check that you understand what you are doing!!
133+
}
134+
135+
get_tool_binaries ()
136+
{
137+
h2 "Getting Tool Binaries"
138+
139+
echo ::
140+
#echo
141+
#(
142+
# mkdir tools
143+
# #make -C $R/../../ dist
144+
# #cp -Rv $R/../../dist/ tools/dpu
145+
# #cp $HOME/x/devel/nidhugg/src/{nidhugg,nidhuggc} tools
146+
# wget XXXXX
147+
# tar xzvf cav18-table1-tool-binaries.tar.gz -C tools
148+
#) 2>&1 | quote
149+
150+
#DPU="tools/dpu/bin/dpu"
151+
#NIDHUGG="tools/nidhuggc --nidhugg=tools/nidhugg"
152+
153+
DPU=../../../../dist/bin/dpu
154+
NIDHUGG="nidhuggc --nidhugg=nidhugg"
155+
}
156+
157+
main ()
158+
{
159+
h1_date "Generation of Table 3"
160+
161+
echo 'This is the output of the script ``runsvcomp17.sh``.'
162+
echo 'It has been produced during the generation of the data for'
163+
echo 'Table 3 in the paper.'
164+
165+
#print_machine_infos
166+
get_tool_binaries
167+
dry_run
168+
169+
h1_date "Preprocessing benchmark"
170+
echo ::
171+
echo
172+
generate_bench_selection 2>&1 | quote
173+
174+
h1_date "Running tool DPU"
175+
echo ::
176+
echo
177+
runall_dpu 2>&1 | quote
178+
179+
180+
h1_date "Running tool NIDHUGG"
181+
echo ::
182+
echo
183+
runall_nidhugg 2>&1 | quote
184+
185+
h1_date "Generating latex tables"
186+
echo ::
187+
echo
188+
#dump_latex 2>&1 | quote
189+
190+
echo
191+
echo
192+
echo End of the log.
193+
echo
194+
echo -n "Date: "
195+
date -R
196+
}
197+
198+
R=logs.$(date +%F_%a_%T)
199+
rm -Rf table3/logs table1/$R
200+
201+
mkdir -p table3/$R
202+
cd table3
203+
ln -s $R logs
204+
cd $R
205+
206+
R=../.. # root of the svcomp17/ folder
207+
main 2>&1 | tee OUTPUT.rst
208+

0 commit comments

Comments
 (0)