You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.8 KiB

  1. #! /bin/bash
  2. WHAT=$1
  3. DIR=$2
  4. echo $WHAT script generation
  5. cat $WHAT.hh > $WHAT.gnuplot
  6. DATA_FILE=`find $DIR -name "*.dat" | grep $WHAT`
  7. echo plot \\ >> $WHAT.gnuplot
  8. for FILE in $DATA_FILE
  9. do
  10. LAST=$FILE
  11. done
  12. echo LAST=$LAST
  13. for FILE in $DATA_FILE
  14. do
  15. if [ $FILE != $LAST ]
  16. then
  17. BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat}
  18. echo "'"$FILE"'" title "'"$TITLE"'" ",\\" >> $WHAT.gnuplot
  19. fi
  20. done
  21. BASE=${LAST##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat}
  22. echo "'"$LAST"'" title "'"$TITLE"'" >> $WHAT.gnuplot
  23. #echo set term postscript color >> $WHAT.gnuplot
  24. #echo set output "'"$WHAT.ps"'" >> $WHAT.gnuplot
  25. echo set term pbm small color >> $WHAT.gnuplot
  26. echo set output "'"$WHAT.ppm"'" >> $WHAT.gnuplot
  27. echo plot \\ >> $WHAT.gnuplot
  28. for FILE in $DATA_FILE
  29. do
  30. if [ $FILE != $LAST ]
  31. then
  32. BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat}
  33. echo "'"$FILE"'" title "'"$TITLE"'" ",\\" >> $WHAT.gnuplot
  34. fi
  35. done
  36. BASE=${LAST##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat}
  37. echo "'"$LAST"'" title "'"$TITLE"'" >> $WHAT.gnuplot
  38. echo set term jpeg large >> $WHAT.gnuplot
  39. echo set output "'"$WHAT.jpg"'" >> $WHAT.gnuplot
  40. echo plot \\ >> $WHAT.gnuplot
  41. for FILE in $DATA_FILE
  42. do
  43. if [ $FILE != $LAST ]
  44. then
  45. BASE=${FILE##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat}
  46. echo "'"$FILE"'" title "'"$TITLE"'" ",\\" >> $WHAT.gnuplot
  47. fi
  48. done
  49. BASE=${LAST##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat}
  50. echo "'"$LAST"'" title "'"$TITLE"'" >> $WHAT.gnuplot
  51. gnuplot -persist < $WHAT.gnuplot
  52. rm $WHAT.gnuplot