# /bin/zsh # This script runs the benchmark as presented in the paper # Files from RERSchallenge, category "Sequential Reachability Problems" # Note that we exclude from this benchmark all files that fall in the # category "Sequential Reachability Problems/data structures, hard" since # they require complex array manipulation that are not yet supported by # the Go2Pins tool. FILES="RERS/2016-Problem10.go \ RERS/2016-Problem11.go \ RERS/2016-Problem12.go \ RERS/2016-Problem14.go \ RERS/2016-Problem15.go \ RERS/2017-Problem10.go \ RERS/2017-Problem11.go \ RERS/2017-Problem12.go \ RERS/2017-Problem14.go \ RERS/2017-Problem15.go \ RERS/2018-Problem10.go \ RERS/2018-Problem11.go \ RERS/2019-Problem11.go \ RERS/2019-Problem12.go \ RERS/2019-Problem14.go \ RERS/2019-Problem15.go " OUTPUT=benchs.csv echo "#filename,loc,transpile_time,compile_time,total_time,final_num_var,final_loc" > $OUTPUT for model in $FILES; do echo "==> Processing $model" loc=$(wc -l $model| awk '{print $1}') echo " - Line of code (original file):\t$loc" filename=$(basename -- "$model") filename="${filename%.*}" rers_inputs=$(cat $model | grep 'var inputs \[\]int' | \ sed 's/var inputs \[\]int = \[\]int{//g' | \ sed 's/}//g' | sed 's/ *//g' | sed 's/,/;/g') start=$(date +%s.%N) ../go2pins -f -o $filename -rers "$rers_inputs" $model > /dev/null 2>&1 end=$(date +%s.%N) transpile_time=$(python -c "print ('%.3f' % (${end} - ${start}))") echo " - Go2Pins processing:\t\t$transpile_time seconds" start=$(date +%s.%N) make -C $filename > /dev/null 2>&1 end=$(date +%s.%N) compile_time=$(python -c "print ('%.3f' % (${end} - ${start}))") echo " - Compiling output:\t\t\t$compile_time seconds" total_time=`echo "$compile_time + $transpile_time"| bc` echo " - Total Time:\t\t\t$total_time seconds" final_num_var=$($filename/main --displaylist | grep '\-' | wc -l) echo " - Number of variables:\t\t$final_num_var" 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 done echo file : $OUTPUT contains the CSV of all previous values