Mercurial > cgi-bin > hgwebdir.cgi > PR > Applications > VSs > VSs__H264__App
comparison ffmpeg_smp/benchmark.sh @ 1:11d15c47beaf
add h264 decoder code
| author | Nina Engelhardt <nengel@mailbox.tu-berlin.de> |
|---|---|
| date | Mon, 27 Aug 2012 12:09:56 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:4b7ceae54a67 |
|---|---|
| 1 #! /bin/bash | |
| 2 | |
| 3 workers=(1 4 8 12 16 20 24 28 32) | |
| 4 cpus=(0 3 7 15 15 23 23 31 31) | |
| 5 nodes=(0 0 0 1 1 2 2 3 3) | |
| 6 | |
| 7 confs=( "1 1 1" "1 2 2" "2 3 4" "2 4 5" "3 5 8" "3 6 10" "4 7 12" "4 8 15" "5 8 17" #small | |
| 8 "1 1 1" "1 2 2" "2 3 4" "2 4 5" "3 5 7" "3 6 9" "4 7 12" "4 8 13" "5 10 15") #large | |
| 9 | |
| 10 | |
| 11 | |
| 12 #confsmall=("1 1 1" "1 2 2" "2 3 4" "2 4 5" "3 5 8" "3 6 10" "4 7 12" "4 8 15" "5 8 17") | |
| 13 # "7 10 21" "8 12 25" "10 15 29" "11 17 32") | |
| 14 #conflarge=("1 1 1" "1 2 2" "2 3 4" "2 4 5" "3 5 7" "3 6 9" "4 7 12" "4 8 13" "5 10 15") | |
| 15 #"5 12 21" "6 15 25" "7 17 30" "8 19 36") | |
| 16 | |
| 17 | |
| 18 configs=9 | |
| 19 | |
| 20 average_ompss_2d=0 | |
| 21 average_ompss_3d=0 | |
| 22 average_pthread=0 | |
| 23 average_serial=0 | |
| 24 | |
| 25 iterations_low=4 | |
| 26 iterations_high=8 | |
| 27 | |
| 28 nframes=10000 # max frames limit for debug purpose | |
| 29 inputs=("14" "10") | |
| 30 inputs_vebose=("Big Bug Bunny 1920x1080 10000 frames" "Park Joy 3840x2160 2500 frames") | |
| 31 osargs=("-z 8 8" "-z 12 12 --static-3d") | |
| 32 | |
| 33 time_stamp=`date +%Y.%m.%d_%H.%M.%S` | |
| 34 outputdir="/home/stefan.hauser/ffmpeg_smp/ppopp_results/rx600s5-1t/$time_stamp" | |
| 35 ompss_2d="$outputdir/ompss_2d.txt" | |
| 36 ompss_3d="$outputdir/ompss_3d.txt" | |
| 37 pthread="$outputdir/pthread.txt" | |
| 38 serial="$outputdir/serial.txt" | |
| 39 | |
| 40 #executes the experiments for a single conf $1=confnum $2 iterations $3 input_idx | |
| 41 function execute_single_conf { | |
| 42 conf=$1 | |
| 43 iter=$2 | |
| 44 iidx=$3 | |
| 45 | |
| 46 average_ompss_2d=0 | |
| 47 average_ompss_3d=0 | |
| 48 average_pthread=0 | |
| 49 | |
| 50 echo "Workers: " ${workers[$conf]} | tee -a $ompss_2d $ompss_3d $pthread $serial | |
| 51 | |
| 52 cd build-ss | |
| 53 for ((i=1;i<=$iter;i+=1)); do | |
| 54 # OMPSS | |
| 55 #export CSS_NUM_CPUS=$worker | |
| 56 NX_PES=${workers[$conf]} numactl --interleave=0-${nodes[$conf]} time -p ./ffmpeg -i ${inputs[$iidx]} -n $nframes -e $((${workers[$conf]}+1)) ${osargs[0]} 2> output | |
| 57 runtime=$(cat output | grep real | sed s/^.*l.//g) | |
| 58 average_ompss_2d=$(echo "$average_ompss_2d + $runtime"|bc) | |
| 59 echo -n $runtime " " >> $ompss_2d | |
| 60 done | |
| 61 | |
| 62 for ((i=1;i<=$iter;i+=1)); do | |
| 63 NX_PES=${workers[$conf]} numactl --interleave=0-${nodes[$conf]} time -p ./ffmpeg -i ${inputs[$iidx]} -n $nframes -e $((${workers[$conf]}+1)) ${osargs[1]} 2> output | |
| 64 runtime=$(cat output | grep real | sed s/^.*l.//g) | |
| 65 average_ompss_3d=$(echo "$average_ompss_3d + $runtime"|bc) | |
| 66 echo -n $runtime " " >> $ompss_3d | |
| 67 done | |
| 68 cd .. | |
| 69 | |
| 70 cd build | |
| 71 for ((i=1;i<=$iter;i+=1)); do | |
| 72 # Pthreads | |
| 73 numactl --physcpubind=0-$((${cpus[$conf]})) time -p ./ffmpeg -i ${inputs[$iidx]} -n $nframes -t ${confs[$(($conf + $iidx * $configs))]} 2> output | |
| 74 runtime=$(cat output | grep real | sed s/^.*l.//g) | |
| 75 average_pthread=$(echo "$average_pthread + $runtime"|bc) | |
| 76 echo -n $runtime " " >> $pthread | |
| 77 done | |
| 78 cd .. | |
| 79 | |
| 80 echo "" | tee -a $pthread $ompss_2d $ompss_3d | |
| 81 average_ompss_2d=$(echo "scale=5;$average_ompss_2d/$iter"|bc) | |
| 82 average_ompss_3d=$(echo "scale=5;$average_ompss_3d/$iter"|bc) | |
| 83 average_pthread=$(echo "scale=5;$average_pthread/$iter"|bc) | |
| 84 | |
| 85 echo "time: " $average_ompss_2d >> $ompss_2d | |
| 86 echo "time: " $average_ompss_3d >> $ompss_3d | |
| 87 echo "time: " $average_pthread >> $pthread | |
| 88 echo "time: " $average_serial >> $serial | |
| 89 } | |
| 90 | |
| 91 | |
| 92 mkdir $outputdir | |
| 93 | |
| 94 echo "Processing inputs ..." | |
| 95 | |
| 96 echo "h264dec Benchmark" | tee $ompss_2d $ompss_3d $pthread $serial | |
| 97 | |
| 98 for n in 0 1; do | |
| 99 echo "Input: ${inputs_vebose[$n]}" | tee -a $ompss_2d $ompss_3d $pthread $serial | |
| 100 echo "" | tee -a $ompss_2d $ompss_3d $pthread $serial | |
| 101 | |
| 102 # Serial | |
| 103 cd build | |
| 104 numactl --physcpubind=0 time -p ./ffmpeg -i ${inputs[$n]} -n $nframes -s 2> output | |
| 105 runtime=$(cat output | grep real | sed s/^.*l.//g) | |
| 106 average_serial=$runtime | |
| 107 cd .. | |
| 108 | |
| 109 execute_single_conf 0 1 $n | |
| 110 | |
| 111 #Parallel | |
| 112 for ((confidx=1;confidx<=4;confidx+=1)); do | |
| 113 execute_single_conf $confidx $iterations_low $n | |
| 114 done | |
| 115 | |
| 116 for ((confidx=5;confidx<=$(($configs-1));confidx+=1)); do | |
| 117 execute_single_conf $confidx $iterations_high $n | |
| 118 done | |
| 119 | |
| 120 echo "-------------------" | tee -a $ompss_2d $ompss_3d $pthread $serial | |
| 121 done | |
| 122 | |
| 123 echo "FINISHED" | |
| 124 | |
| 125 rm build/output build-ss/output | |
| 126 |
