go.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. echo Compile with gcc -O2
  3. rm -f *.bin
  4. rm -f ../scattnlay
  5. #g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay.bin -static
  6. # g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay-pg.bin -static -pg
  7. #google profiler ######## FAST!!!
  8. # g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay.bin /usr/lib/libtcmalloc.so.4 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -march=native -mtune=native -msse4.2
  9. # g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay-g.bin -ltcmalloc -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -g
  10. #DEBUG!
  11. clang++ -g -O1 -fsanitize=address -fno-optimize-sibling-calls -fno-omit-frame-pointer -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay.bin
  12. cp scattnlay.bin ../scattnlay
  13. # cp scattnlay-g.bin ../scattnlay-g
  14. cd tests/shell
  15. # for file in `ls *.sh`; do
  16. # if [ "$file" != "test03.sh" ]; then
  17. # ./$file > /dev/null
  18. # echo $file
  19. # fi
  20. # done
  21. PROGRAM='../../../scattnlay'
  22. # time ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4
  23. #time
  24. time $PROGRAM -l 5 0.4642 1.8000 1.7000 0.7114 0.8000 0.7000 0.7393 1.2000 0.0900 0.9168 2.8000 0.2000 1.0000 1.5000 0.4000 -t 0.0 90.0 5 -c test01
  25. # #apt-get install oprofile
  26. # echo oprofile
  27. # PROGRAM='../../../scattnlay-g'
  28. # rm -rf oprofiletmp
  29. # rm -rf oprofile_data
  30. # time operf $PROGRAM -l 5 0.4642 1.8000 1.7000 0.7114 0.8000 0.7000 0.7393 1.2000 0.0900 0.9168 2.8000 0.2000 1.0000 1.5000 0.4000 -t 0.0 90.0 5 -c test01
  31. # #opreport --symbols > opreport.log
  32. # mkdir oprofiletmp
  33. # opannotate --source --output-dir=./oprofiletmp/
  34. #echo valgring
  35. # valgrind --tool=callgrind $PROGRAM -l 5 0.4642 1.8000 1.7000 0.7114 0.8000 0.7000 0.7393 1.2000 0.0900 0.9168 2.8000 0.2000 1.0000 1.5000 0.4000 -t 0.0 90.0 5 -c test01
  36. # rm out.dot
  37. # ./gprof2dot.py --output=out.dot --format=callgrind callgrind.out.*
  38. # mv callgrind.out.* callgrind
  39. # dot -Tsvg out.dot -o graph.svg
  40. # rm *.aprof
  41. # /home/mmedia/soft/aprof-0.2.1/inst/bin/valgrind --tool=aprof $PROGRAM -l 5 0.4642 1.8000 1.7000 0.7114 0.8000 0.7000 0.7393 1.2000 0.0900 0.9168 2.8000 0.2000 1.0000 1.5000 0.4000 -t 0.0 90.0 5 -c test01
  42. # rm gmon.out
  43. # rm analysis.txt
  44. # PROGRAM='../../../scattnlay-pg'
  45. # time $PROGRAM -l 5 0.4642 1.8000 1.7000 0.7114 0.8000 0.7000 0.7393 1.2000 0.0900 0.9168 2.8000 0.2000 1.0000 1.5000 0.4000 -t 0.0 90.0 5 -c test01
  46. # gprof $PROGRAM gmon.out > analysis.txt
  47. # repeats=30
  48. # echo Run test for $repeats times
  49. # time for i in `seq $repeats`; do ./test01.sh; done
  50. # echo Run test with original binary for $repeats times
  51. # cp ../../../scattnlay-0.3.0 ../../../scattnlay
  52. # time for i in `seq $repeats`; do ./test01.sh; done