go.sh 4.4 KB

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