diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ffmpeg_smp/benchmark.sh	Mon Aug 27 12:09:56 2012 +0200
     1.3 @@ -0,0 +1,126 @@
     1.4 +#! /bin/bash
     1.5 +
     1.6 +workers=(1 4 8 12 16 20 24 28 32)
     1.7 +cpus=(0 3 7 15 15 23 23 31 31)
     1.8 +nodes=(0 0 0 1 1 2 2 3 3)
     1.9 +
    1.10 +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
    1.11 +		"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
    1.12 +
    1.13 +
    1.14 +
    1.15 +#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")
    1.16 +# "7 10 21" "8 12 25" "10 15 29" "11 17 32")
    1.17 +#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")
    1.18 +#"5 12 21" "6 15 25" "7 17 30" "8 19 36")
    1.19 +
    1.20 +
    1.21 +configs=9
    1.22 +
    1.23 +average_ompss_2d=0
    1.24 +average_ompss_3d=0
    1.25 +average_pthread=0
    1.26 +average_serial=0
    1.27 +
    1.28 +iterations_low=4
    1.29 +iterations_high=8
    1.30 +
    1.31 +nframes=10000  # max frames limit for debug purpose
    1.32 +inputs=("14" "10")
    1.33 +inputs_vebose=("Big Bug Bunny 1920x1080 10000 frames" "Park Joy 3840x2160 2500 frames")
    1.34 +osargs=("-z 8 8" "-z 12 12 --static-3d")
    1.35 +
    1.36 +time_stamp=`date +%Y.%m.%d_%H.%M.%S`
    1.37 +outputdir="/home/stefan.hauser/ffmpeg_smp/ppopp_results/rx600s5-1t/$time_stamp"
    1.38 +ompss_2d="$outputdir/ompss_2d.txt"
    1.39 +ompss_3d="$outputdir/ompss_3d.txt"
    1.40 +pthread="$outputdir/pthread.txt"
    1.41 +serial="$outputdir/serial.txt"
    1.42 +
    1.43 +#executes the experiments for a single conf $1=confnum $2 iterations $3 input_idx
    1.44 +function execute_single_conf {
    1.45 +	conf=$1
    1.46 +	iter=$2
    1.47 +	iidx=$3
    1.48 +
    1.49 +	average_ompss_2d=0
    1.50 +	average_ompss_3d=0
    1.51 +	average_pthread=0
    1.52 +
    1.53 +	echo "Workers: " ${workers[$conf]} | tee -a $ompss_2d $ompss_3d $pthread $serial
    1.54 +
    1.55 +	cd build-ss
    1.56 +	for ((i=1;i<=$iter;i+=1)); do
    1.57 +	    # OMPSS
    1.58 +	    #export CSS_NUM_CPUS=$worker
    1.59 +	    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
    1.60 +		runtime=$(cat output | grep real | sed s/^.*l.//g)
    1.61 +	    average_ompss_2d=$(echo "$average_ompss_2d + $runtime"|bc)
    1.62 +	    echo -n $runtime " " >> $ompss_2d
    1.63 +	done
    1.64 +
    1.65 +	for ((i=1;i<=$iter;i+=1)); do
    1.66 +		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
    1.67 +		runtime=$(cat output | grep real | sed s/^.*l.//g)
    1.68 +	    average_ompss_3d=$(echo "$average_ompss_3d + $runtime"|bc)
    1.69 +	    echo -n $runtime " " >> $ompss_3d
    1.70 +	done
    1.71 +	cd ..
    1.72 +
    1.73 +	cd build
    1.74 +	for ((i=1;i<=$iter;i+=1)); do
    1.75 +		# Pthreads
    1.76 +	    numactl --physcpubind=0-$((${cpus[$conf]})) time -p ./ffmpeg -i ${inputs[$iidx]} -n $nframes -t ${confs[$(($conf + $iidx * $configs))]} 2> output
    1.77 +		runtime=$(cat output | grep real | sed s/^.*l.//g)
    1.78 +	    average_pthread=$(echo "$average_pthread + $runtime"|bc)
    1.79 +	    echo -n $runtime " " >> $pthread
    1.80 +	done
    1.81 +	cd ..
    1.82 +
    1.83 +	echo "" | tee -a $pthread $ompss_2d $ompss_3d
    1.84 +	average_ompss_2d=$(echo "scale=5;$average_ompss_2d/$iter"|bc)
    1.85 +	average_ompss_3d=$(echo "scale=5;$average_ompss_3d/$iter"|bc)
    1.86 +	average_pthread=$(echo "scale=5;$average_pthread/$iter"|bc)
    1.87 +
    1.88 +	echo "time: " $average_ompss_2d >> $ompss_2d
    1.89 +	echo "time: " $average_ompss_3d >> $ompss_3d
    1.90 +	echo "time: " $average_pthread >> $pthread
    1.91 +	echo "time: " $average_serial >> $serial
    1.92 +}
    1.93 +
    1.94 +
    1.95 +mkdir $outputdir
    1.96 +
    1.97 +echo "Processing inputs ..."
    1.98 +
    1.99 +echo "h264dec Benchmark" | tee $ompss_2d $ompss_3d $pthread $serial
   1.100 +
   1.101 +for n in 0 1; do
   1.102 +	echo "Input: ${inputs_vebose[$n]}" | tee -a $ompss_2d $ompss_3d $pthread $serial
   1.103 +	echo "" | tee -a $ompss_2d $ompss_3d $pthread $serial
   1.104 +
   1.105 +	# Serial
   1.106 +	cd build
   1.107 +	numactl --physcpubind=0 time -p ./ffmpeg -i ${inputs[$n]} -n $nframes -s 2> output
   1.108 +	runtime=$(cat output | grep real | sed s/^.*l.//g)
   1.109 +	average_serial=$runtime
   1.110 +	cd ..
   1.111 +
   1.112 +	execute_single_conf 0 1 $n
   1.113 +
   1.114 +	#Parallel
   1.115 +	for ((confidx=1;confidx<=4;confidx+=1)); do
   1.116 +		execute_single_conf $confidx $iterations_low $n		
   1.117 +	done
   1.118 +
   1.119 +	for ((confidx=5;confidx<=$(($configs-1));confidx+=1)); do
   1.120 +		execute_single_conf $confidx $iterations_high $n		
   1.121 +	done
   1.122 +
   1.123 +	echo "-------------------" | tee -a $ompss_2d $ompss_3d $pthread $serial
   1.124 +done
   1.125 +
   1.126 +echo "FINISHED"
   1.127 +
   1.128 +rm build/output build-ss/output
   1.129 +