go.sh 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.4 $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
  23. #result
  24. # test01, +1.41154e+00, +4.17695e-01, +9.93844e-01, +1.59427e-01, +1.25809e+00, +3.67376e-01, +2.95915e-01
  25. echo BUG -- All 3 designs should give almost the same answer
  26. #echo
  27. #echo $PROGRAM -l 1 4.71238898038469 2 0.0001
  28. $PROGRAM -l 1 4.71238898038469 2 0.0001
  29. #echo
  30. #echo $PROGRAM -l 2 4.71238898038469 2 0.0001 9.42477796076937 1 0
  31. $PROGRAM -l 2 4.71238898038469 2 0.0001 9.42477796076937 1 0
  32. #echo
  33. #echo $PROGRAM -l 2 4.71238898038469 2 0.0001 9.42477796076938 1 0
  34. $PROGRAM -l 2 4.71238898038469 2 0.0001 9.42477796076938 1 0
  35. echo
  36. # #apt-get install oprofile
  37. # echo oprofile
  38. # PROGRAM='../../../scattnlay-g'
  39. # rm -rf oprofiletmp
  40. # rm -rf oprofile_data
  41. # 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
  42. # #opreport --symbols > opreport.log
  43. # mkdir oprofiletmp
  44. # opannotate --source --output-dir=./oprofiletmp/
  45. #echo valgring
  46. # 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
  47. # rm out.dot
  48. # ./gprof2dot.py --output=out.dot --format=callgrind callgrind.out.*
  49. # mv callgrind.out.* callgrind
  50. # dot -Tsvg out.dot -o graph.svg
  51. # rm *.aprof
  52. # /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
  53. # rm gmon.out
  54. # rm analysis.txt
  55. # PROGRAM='../../../scattnlay-pg'
  56. # 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
  57. # gprof $PROGRAM gmon.out > analysis.txt
  58. # repeats=30
  59. # echo Run test for $repeats times
  60. # time for i in `seq $repeats`; do ./test01.sh; done
  61. # echo Run test with original binary for $repeats times
  62. # cp ../../../scattnlay-0.3.0 ../../../scattnlay
  63. # time for i in `seq $repeats`; do ./test01.sh; done