3 #Terminate the script if even one command fails
9 PROBLEMS=./testcase/*.problem
11 #Checking the number of
12 if [ "$#" -lt 1 ]; then
13 echo "Illegal number of argument"
14 echo "./bench.sh [NUMBER] [--csolver/--dump]"
20 for PAR in $PROBLEMS; do
22 for ((i=0; i<"$1"; i++)); do
23 echo "begin iteration: $i" >>$TEMP
24 if [ "$#" -eq 1 ]; then
26 timeout $TIMEMAX ./run.sh python Sudoku.py --file $PAR >> $TEMP
28 DIFF=$(echo "$END - $START" | bc)
30 echo "Program Execution Time: $DIFF" >>$TEMP
32 if [ $2 = '--dump' ]; then
34 timeout $TIMEMAX ./run.sh python Sudoku.py --file $PAR --dump >> $TEMP
36 DIFF=$(echo "$END - $START" | bc)
38 echo "Program Execution Time: $DIFF" >>$TEMP
41 elif [ $2 = '--csolver' ]; then
43 timeout $TIMEMAX ./run.sh python Sudoku.py --file $PAR --csolver >> $TEMP
45 DIFF=$(echo "$END - $START" | bc)
47 echo "Program Execution Time: $DIFF" >>$TEMP
49 echo "Unknown command : " $2