Commit db579dc0 authored by Etienne Renault's avatar Etienne Renault
Browse files

benchs: script now integrates blackbox evaluation

* benchs/run-benchmark.sh: Here.
parent d53bc542
......@@ -43,6 +43,7 @@ FILES="RERS/2016-Problem10.go \
RERS/2019-Problem15.go "
OUTPUT=benchs.csv
OUTPUT_BB=benchs-bb.csv
GOCACHE=$(go env | grep CACHE | sed 's/GOCACHE="//g' | sed 's/"//g')
echo "#filename,loc,transpile_time,compile_time,total_time,final_num_var,final_loc" > $OUTPUT
......@@ -81,7 +82,46 @@ for model in $FILES; do
loc2=$(wc -l $filename/$filename.go| tail -n1|awk '{print $1}')
echo " - Line of code generated:\t\t$loc2"
echo
echo "$filename,$loc,$transpile_time,$compile_time,$total_time,$final_num_var,$loc2" >> benchs.csv
echo "$filename,$loc,$transpile_time,$compile_time,$total_time,$final_num_var,$loc2" >> $OUTPUT
done
echo file : $OUTPUT contains the CSV of all previous values
#######################
# Blackbox evaluation
######################
NB_FUN=$(cat sqrt_prime_fibo.go | grep compute_main | grep -v func | wc -l)
echo
echo "==> Benchmark for BlackBox."
echo
echo "/!\ Note that some of these tests require huge amount of memory /!\ "
echo
echo "bb-percent,states,transitions" > $OUTPUT_BB
for i in 90 90; do
PERCENT=$i
model=sqrt_prime_fibo.go
echo "==> Processing file 'sqrt_prime_fibo.go' with $PERCENT% BlackBox"
HOW_MANY=$((NB_FUN*PERCENT/100))
BB=$(cat sqrt_prime_fibo.go | grep compute_main | grep -v func | head -n $HOW_MANY| tr '\n' ';' | sed 's/\t*//g' | sed 's/([^)]*)//g' )
BB=$(echo "${BB%?}") # remove last semicolumn
../go2pins -f -o "sqrt_prime_fibo_$PERCENT" -blackbox-fn "$BB" $model > /dev/null 2>&1
cd sqrt_prime_fibo_$PERCENT
make > /dev/null 2>&1
RESULT=$(./go2pins-mc -kripke-size| sed "s/kripke/$PERCENT/g" | grep "^#")
cat $OUTPUT_BB
ST=$(echo $RESULT | awk -F',' '{print $2}')
TR=$(echo $RESULT | awk -F',' '{print $3}')
echo " - States: $ST states"
echo " - Transitions: $TR transitions"
echo
cd ..
echo $RESULT >> $OUTPUT_BB
done
echo
echo file : $OUTPUT_BB contains the CSV of blackbox evaluation
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment