go.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. #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
  8. cp scattnlay.bin ../scattnlay
  9. cp scattnlay-pg.bin ../scattnlay-pg
  10. cd tests/shell
  11. # for file in `ls *.sh`; do
  12. # if [ "$file" != "test03.sh" ]; then
  13. # ./$file > /dev/null
  14. # echo $file
  15. # fi
  16. # done
  17. PROGRAM='../../../scattnlay'
  18. # time ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4
  19. # 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
  20. # echo valgring
  21. # 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
  22. # rm out.dot
  23. # ./gprof2dot.py --output=out.dot --format=callgrind callgrind.out.*
  24. # mv callgrind.out.* callgrind
  25. # dot -Tsvg out.dot -o graph.svg
  26. rm gmon.out
  27. rm analysis.txt
  28. PROGRAM='../../../scattnlay-pg'
  29. 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
  30. gprof $PROGRAM gmon.out > analysis.txt
  31. # repeats=30
  32. # echo Run test for $repeats times
  33. # time for i in `seq $repeats`; do ./test01.sh; done
  34. # echo Run test with original binary for $repeats times
  35. # cp ../../../scattnlay-0.3.0 ../../../scattnlay
  36. # time for i in `seq $repeats`; do ./test01.sh; done