Bug fix for return value in runbench script
[satune.git] / src / Scripts / runbench.sh
1 #!/bin/bash
2 # run as the following:
3 # ./runbench.sh [hexiom] [timeout] [tuner.conf]
4 # ./runbench.sh [nqueens] [timeout] [tuner.conf]
5 # ./runbench.sh [sudoku-csolver] [timeout] [tuner.conf]
6 # ./runbench.sh [killerSudoku] [timeout] [tuner.conf]
7
8 if [ "$#" -lt 3 ]; then
9         echo "Illegal number of argument"
10         echo "./runbench.sh [benchmark] [timeout] [tuner.conf]"
11         exit 1
12 fi
13
14
15 BIN=./bin
16 DUMP=$(find . -name "*.dump")
17 cd $BIN
18 for d in $DUMP; do
19         if [[ $d = *$1* ]]; then
20                 echo "Running: ./run.sh tunerrun "."$d $2 $3 out.out"
21                 ./run.sh tunerrun "."$d $2 $3 out.out
22                 RETCODE=$?
23                 echo "Return code: $RETCODE"
24                 if [ $RETCODE -eq 141 ]; then #Dump info when SAT Solver gets killed by OS ....
25                         echo "Satune got out of memory"
26                         echo "deserializing $d ..."
27                         echo "SAT Solving time: 400000000.0"
28                         echo "CSOLVER solve time: 400000000.0"
29                 fi
30                 echo "Best tuner"
31         fi
32 done