Home | History | Annotate | Download | only in scripts
      1 #!/bin/bash
      2 
      3 ########################
      4 # Function definitions #
      5 ########################
      6 
      7 source "$(dirname $0)/measurement-functions"
      8 
      9 ########################
     10 # Script body          #
     11 ########################
     12 
     13 DRD_SCRIPTS_DIR="$(dirname $0)"
     14 if [ "${DRD_SCRIPTS_DIR:0:1}" != "/" ]; then
     15   DRD_SCRIPTS_DIR="$PWD/$DRD_SCRIPTS_DIR"
     16 fi
     17 
     18 VG="${DRD_SCRIPTS_DIR}/../../vg-in-place"
     19 MATINV="${DRD_SCRIPTS_DIR}/../../drd/tests/matinv"
     20 
     21 
     22 for n in 200 400
     23 do
     24   tmp="/tmp/test-timing.$$"
     25   rm -f "${tmp}"
     26 
     27   measure_runtime ${MATINV} $n | avgstddev > "$tmp"
     28   read avg1 stddev1 vsz1 vszdev1 < "$tmp"
     29   echo "Average time: ${avg1} +/- ${stddev1} seconds." \
     30        " VSZ: ${vsz1} +/- ${vszdev1} KB"
     31 
     32   for i in 1 10
     33   do
     34     print_runtime_ratio ${avg1} ${stddev1} ${vsz1} ${vszdev1} \
     35       ${VG} --tool=none    ${MATINV} $n -t$i
     36     print_runtime_ratio ${avg1} ${stddev1} ${vsz1} ${vszdev1} \
     37       ${VG} --tool=drd ${MATINV} $n -t$i
     38   done
     39 done
     40