evaluate_expression.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2011-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. nsamples=3
  18. BENCH_NAME=$1
  19. OPTIONS=$2
  20. filename=$3
  21. print_options=$4
  22. gflops1_avg=0
  23. gflops2_avg=0
  24. t1_avg=0
  25. t2_avg=0
  26. t_total_avg=0
  27. for s in `seq 1 $nsamples`
  28. do
  29. echo "$ROOTDIR/examples/$BENCH_NAME $OPTIONS"
  30. val=`$STARPU_LAUNCH $ROOTDIR/examples/$BENCH_NAME $OPTIONS`
  31. echo "$val"
  32. results=($val)
  33. gflops1_avg=$(echo "$gflops1_avg+${results[0]}"|bc -l)
  34. gflops2_avg=$(echo "$gflops2_avg+${results[1]}"|bc -l)
  35. t1_avg=$(echo "$t1_avg+${results[2]}"|bc -l)
  36. t2_avg=$(echo "$t2_avg+${results[3]}"|bc -l)
  37. t_total_avg=$(echo "$t_total_avg+${results[4]}"|bc -l)
  38. done
  39. gflops1_avg=$(echo "$gflops1_avg / $nsamples"|bc -l)
  40. gflops2_avg=$(echo "$gflops2_avg / $nsamples"|bc -l)
  41. t1_avg=$(echo "$t1_avg / $nsamples"|bc -l)
  42. t2_avg=$(echo "$t2_avg / $nsamples"|bc -l)
  43. t_total_avg=$(echo "$t_total_avg / $nsamples"|bc -l)
  44. echo "$print_options `printf '%2.2f %2.2f %2.2f %2.2f %2.2f' $gflops1_avg $gflops2_avg $t1_avg $t2_avg $t_total_avg`"
  45. echo "$print_options `printf '%2.2f %2.2f %2.2f %2.2f %2.2f' $gflops1_avg $gflops2_avg $t1_avg $t2_avg $t_total_avg`" >> $filename