go.sh 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #!/bin/bash
  2. path=$PWD
  3. file=compare.cc
  4. echo Compile with gcc
  5. rm -f *.bin
  6. rm -f ../scattnlay
  7. #g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay.bin -static
  8. # g++ -Ofast -std=c++11 compare.cc nmie.cc nmie-wrapper.cc -lm -lrt -o scattnlay-pg.bin -static -pg
  9. #google profiler ######## FAST!!!
  10. echo Uncomment next line to compile compare.cc
  11. g++ -Ofast -std=c++11 $file nmie.cc nmie-old.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
  12. # 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
  13. #DEBUG!
  14. #clang++ -g -O1 -fsanitize=address -fno-optimize-sibling-calls -fno-omit-frame-pointer -std=c++11 compare.cc nmie.cc nmie-old.cc -lm -lrt -o scattnlay.bin
  15. cp scattnlay.bin ../scattnlay
  16. # cp scattnlay-g.bin ../scattnlay-g
  17. #cd tests/shell
  18. # for file in `ls *.sh`; do
  19. # if [ "$file" != "test03.sh" ]; then
  20. # ./$file > /dev/null
  21. # echo $file
  22. # fi
  23. # done
  24. PROGRAM='./scattnlay.bin'
  25. time 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
  26. # #result
  27. # # test01, +1.41154e+00, +4.17695e-01, +9.93844e-01, +1.59427e-01, +1.25809e+00, +3.67376e-01, +2.95915e-01
  28. # echo BUG -- All designs should give almost the same answer
  29. # #echo
  30. # echo $PROGRAM -l 1 4.71238898038469 2 0.0001
  31. # $PROGRAM -l 1 4.71238898038469 2 0.0001
  32. # #echo
  33. # echo $PROGRAM -l 2 4.71238898038469 2 0.0001 9.42477796076937 1 0
  34. # $PROGRAM -l 2 4.71238898038469 2 0.0001 9.42477796076937 1.5 0.0001
  35. #echo
  36. #echo $PROGRAM -l 2 4.71238898038469 2 0.0001 9.42477796076938 1 0
  37. #$PROGRAM -l 2 4.71238898038469 2 0.0001 9.42477796076938 1.5 0.0001
  38. #echo
  39. # #apt-get install oprofile
  40. # echo oprofile
  41. # PROGRAM='../../../scattnlay-g'
  42. # rm -rf oprofiletmp
  43. # rm -rf oprofile_data
  44. # 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
  45. # #opreport --symbols > opreport.log
  46. # mkdir oprofiletmp
  47. # opannotate --source --output-dir=./oprofiletmp/
  48. #echo valgring
  49. # 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
  50. # rm out.dot
  51. # ./gprof2dot.py --output=out.dot --format=callgrind callgrind.out.*
  52. # mv callgrind.out.* callgrind
  53. # dot -Tsvg out.dot -o graph.svg
  54. # rm *.aprof
  55. # /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
  56. # rm gmon.out
  57. # rm analysis.txt
  58. # PROGRAM='../../../scattnlay-pg'
  59. # 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
  60. # gprof $PROGRAM gmon.out > analysis.txt
  61. # repeats=30
  62. # echo Run test for $repeats times
  63. # time for i in `seq $repeats`; do ./test01.sh; done
  64. # echo Run test with original binary for $repeats times
  65. # cp ../../../scattnlay-0.3.0 ../../../scattnlay
  66. # time for i in `seq $repeats`; do ./test01.sh; done
  67. #Run static analysis
  68. # echo Run manually:
  69. # echo make clean
  70. # echo ~/../mmedia/soft/cov-analysis-linux64-7.6.0/bin/cov-build --dir cov-int make standalone
  71. # echo tar -zcvf cov-int.tar.gz cov-int
  72. # echo to submit to coverity
  73. # cd $path
  74. # file=test-negative-epsilon.cc
  75. # #g++ -Ofast -std=c++11 $file nmie.cc -lm -lrt -o $file.bin /usr/lib/libtcmalloc.so.4 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -march=native -mtune=native -msse4.2
  76. # #DEBUG!
  77. # clang++ -g -O1 -fsanitize=address -fno-optimize-sibling-calls -fno-omit-frame-pointer -std=c++11 $file nmie.cc -lm -lrt -o $file.bin
  78. # ./$file.bin
  79. ### Cython
  80. # rm scattnlay.so
  81. # export CFLAGS='-std=c++11'
  82. # python setup.py build_ext --inplace
  83. # cp scattnlay.so tests/python/
  84. # cd tests/python/
  85. #./field-Ag-flow.py
  86. # ./lfield.py
  87. # ./field-dielectric-sphere.py
  88. # ./field.py
  89. # ./test01.py
  90. # ./test01-wrapper.py