Mercurial > hg > CbC > CbC_gcc
annotate CbC-examples/quicksort/benchmark.sh @ 92:689bf9141c8c
add conv1/benchmark.sh
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 04 Jan 2012 02:15:01 +0900 |
parents | 607e6dc322e5 |
children |
rev | line source |
---|---|
43 | 1 #!/usr/bin/env zsh |
2 | |
3 time=/usr/bin/time | |
4 QS=./quicksort_cbc | |
5 size=10000000 | |
6 seed=123456789 | |
7 num=10 | |
8 | |
9 | |
10 max=0 | |
11 min=99999 | |
12 count=0 | |
13 amount=0 | |
14 | |
15 echo "size of array = $size" | |
16 while [[ $count -lt $num ]]; do | |
92
689bf9141c8c
add conv1/benchmark.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
43
diff
changeset
|
17 echo "$time -p $QS -n $size -s $seed 2>&1 >& - |grep '^user'|tr -s \" \"|cut -f2 -d\" \" " |
43 | 18 usertime=$( $time -p $QS -n $size -s $seed 2>&1 >& - |grep '^user'|tr -s " "|cut -f2 -d" ") |
19 #usertime=$(printf "%d" $usertime) | |
20 echo $usertime | |
21 | |
22 amount=$(($usertime+$amount)) | |
23 if [[ $usertime -lt $min ]]; then | |
24 min=$usertime | |
25 fi | |
26 if [[ $usertime -gt $max ]]; then | |
27 max=$usertime | |
28 fi | |
29 #seed=$seed[1,-2] | |
30 seed=$(($seed+10)) | |
31 count=$(($count+1)) | |
32 done | |
33 | |
34 echo "amount time = $amount" | |
35 echo "maxtime = $max" | |
36 echo "mintime = $min" | |
37 | |
38 amount=$(($amount - $max - $min)) | |
39 echo "amount time - mintime - maxtime = $amount" | |
40 count=$(($count-2)) | |
41 echo "count = $count" | |
42 averagetime=$(($amount/($count))) | |
43 echo "average time = $averagetime" | |
44 | |
45 |