coverage_test.sh 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. #!/bin/bash
  2. #
  3. # StarPU
  4. # Copyright (C) Université Bordeaux 1, CNRS 2008-2010 (see AUTHORS file)
  5. #
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. DIR=$PWD
  18. ROOTDIR=$DIR/../..
  19. WORKDIR=`mktemp -d`
  20. COVDIR=$WORKDIR/coverage
  21. BUILDDIR=$WORKDIR/build
  22. INSTALLDIR=$WORKDIR/local
  23. EXAMPLEDIR=$INSTALLDIR/lib/starpu/examples/
  24. LOGFILE=`mktemp`
  25. init()
  26. {
  27. mkdir -p $INSTALLDIR
  28. mkdir -p $BUILDDIR
  29. mkdir -p $COVDIR
  30. lcov --directory $BUILDDIR --zerocounters >$LOGFILE 2>&1
  31. }
  32. save_cov()
  33. {
  34. testname=$1
  35. lcov --directory $BUILDDIR --capture --output $COVDIR/$testname.info >>$LOGFILE 2>&1
  36. lcov -a $COVDIR/$testname.info -o $COVDIR/all.info >>$LOGFILE 2>&1
  37. }
  38. generatehtml()
  39. {
  40. cd $COVDIR
  41. genhtml all.info
  42. cd -
  43. }
  44. apps()
  45. {
  46. echo "incrementer"
  47. $EXAMPLEDIR/incrementer >>$LOGFILE 2>&1
  48. save_cov "incrementer";
  49. echo "tag_example"
  50. $EXAMPLEDIR/tag_example -iter 64 -i 128 -j 24 >>$LOGFILE 2>&1
  51. save_cov "tag_example";
  52. echo "tag_example2"
  53. $EXAMPLEDIR/tag_example2 -iter 64 -i 128 >>$LOGFILE 2>&1
  54. save_cov "tag_example2";
  55. #echo "spmv"
  56. #$BUILDDIR/examples/spmv/dw_spmv >>$LOGFILE 2>&1
  57. #save_cov "spmv";
  58. #
  59. #echo "spmv.gpu"
  60. #STARPU_NCPUS=0 $BUILDDIR/examples/spmv/dw_spmv >>$LOGFILE 2>&1
  61. #save_cov "spmv.gpu";
  62. #
  63. #echo "spmv.cpu"
  64. #STARPU_NCUDA=0 $BUILDDIR/examples/spmv/dw_spmv >>$LOGFILE 2>&1
  65. #save_cov "spmv.cpu";
  66. #
  67. #echo "spmv.dm"
  68. #STARPU_SCHED="dm" $BUILDDIR/examples/spmv/dw_spmv >>$LOGFILE 2>&1
  69. #save_cov "spmv.dm";
  70. #
  71. #echo "spmv.dmda"
  72. #STARPU_SCHED="dmda" $BUILDDIR/examples/spmv/dw_spmv >>$LOGFILE 2>&1
  73. #save_cov "spmv.dmda";
  74. #echo "strassen.ws"
  75. #STARPU_SCHED="ws" $EXAMPLEDIR/dw_strassen -rec 3 -size 2048 -pin >>$LOGFILE 2>&1
  76. #save_cov "strassen.ws";
  77. #
  78. #echo "strassen.dm"
  79. #STARPU_SCHED="dm" $EXAMPLEDIR/dw_strassen -rec 3 -size 2048 -pin >>$LOGFILE 2>&1
  80. #save_cov "strassen.dm";
  81. #
  82. #echo "strassen.dmda"
  83. #STARPU_SCHED="dmda" $EXAMPLEDIR/dw_strassen -rec 3 -size 2048 -pin >>$LOGFILE 2>&1
  84. #save_cov "strassen.dmda";
  85. echo "chol.dm"
  86. STARPU_CALIBRATE=1 STARPU_SCHED="dm" $EXAMPLEDIR/dw_cholesky -pin >>$LOGFILE 2>&1
  87. save_cov "chol.dm";
  88. echo "chol.dmda"
  89. STARPU_CALIBRATE=1 STARPU_SCHED="dmda" $EXAMPLEDIR/dw_cholesky -pin >>$LOGFILE 2>&1
  90. save_cov "chol.dmda";
  91. echo "chol.cpu"
  92. STARPU_CALIBRATE=1 STARPU_NCUDA=0 STARPU_SCHED="dm" $EXAMPLEDIR/dw_cholesky -pin >>$LOGFILE 2>&1
  93. save_cov "chol.cpu";
  94. echo "chol.gpu"
  95. STARPU_CALIBRATE=1 STARPU_NCPUS=0 STARPU_SCHED="dm" $EXAMPLEDIR/dw_cholesky -pin >>$LOGFILE 2>&1
  96. save_cov "chol.gpu";
  97. echo "chol"
  98. $EXAMPLE/dw_cholesky >>$LOGFILE 2>&1
  99. save_cov "chol";
  100. echo "heat.dm.4k.calibrate.v2"
  101. STARPU_CALIBRATE=1 STARPU_SCHED="dm" $EXAMPLEDIR/heat -ntheta 66 -nthick 66 -nblocks 4 -v2 -pin >>$LOGFILE 2>&1
  102. save_cov "heat.dm.4k.calibrate.v2";
  103. echo "heat.dm.8k.calibrate.v2"
  104. STARPU_CALIBRATE=1 STARPU_SCHED="dm" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -v2 -pin >>$LOGFILE 2>&1
  105. save_cov "heat.dm.8k.calibrate.v2";
  106. echo "heat.dm.16k.calibrate.v2"
  107. STARPU_CALIBRATE=1 STARPU_SCHED="dm" $EXAMPLEDIR/heat -ntheta 130 -nthick 130 -nblocks 16 -v2 -pin >>$LOGFILE 2>&1
  108. save_cov "heat.dm.16k.calibrate.v2";
  109. echo "heat.dm.8k.no.pin.v2"
  110. STARPU_SCHED="dm" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -v2 >>$LOGFILE 2>&1
  111. save_cov "heat.dm.8k.no.pin.v2";
  112. #echo "heat.prio.8k"
  113. #STARPU_SCHED="prio" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -v2 -pin >>$LOGFILE 2>&1
  114. #save_cov "heat.prio.8k";
  115. echo "heat.dm.8k.v2.no.prio"
  116. STARPU_SCHED="no-prio" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -pin -v2 >>$LOGFILE 2>&1
  117. save_cov "heat.dm.8k.v2.no.prio";
  118. echo "heat.dm.8k.v2.random"
  119. STARPU_SCHED="random" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -pin -v2 >>$LOGFILE 2>&1
  120. save_cov "heat.dm.8k.v2.random";
  121. echo "heat.dm.8k.v2"
  122. STARPU_SCHED="dm" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -pin -v2 >>$LOGFILE 2>&1
  123. save_cov "heat.dm.8k.v2";
  124. echo "heat.dm.16k.v2"
  125. STARPU_SCHED="dm" $EXAMPLEDIR/heat -ntheta 130 -nthick 130 -nblocks 16 -pin -v2 >>$LOGFILE 2>&1
  126. save_cov "heat.dm.16k.v2";
  127. #echo "heat.ws.8k.v2"
  128. #STARPU_SCHED="ws" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -pin -v2 >>$LOGFILE 2>&1
  129. #save_cov "heat.ws.8k.v2";
  130. echo "heat.greedy.8k.v2"
  131. STARPU_SCHED="greedy" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -pin -v2 >>$LOGFILE 2>&1
  132. save_cov "heat.greedy.8k.v2";
  133. echo "heat.8k.cg"
  134. $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -pin -v2 -cg >>$LOGFILE 2>&1
  135. save_cov "heat.8k.cg";
  136. echo "heat.dm.8k.cg"
  137. STARPU_SCHED="dm" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -pin -v2 -cg >>$LOGFILE 2>&1
  138. save_cov "heat.dm.8k.cg";
  139. #echo "heat.dm.8k.v3"
  140. #STARPU_SCHED="dm" $EXAMPLEDIR/heat -ntheta 66 -nthick 130 -nblocks 8 -pin -v3 >>$LOGFILE 2>&1
  141. #save_cov "heat.dm.8k.v3";
  142. echo "mult.dm.common"
  143. STARPU_SCHED="dm" $EXAMPLEDIR/dw_mult -nblocks 4 -x 4096 -y 4096 -z 1024 -pin -common-model >>$LOGFILE 2>&1
  144. save_cov "mult.dm.common";
  145. echo "mult.dm"
  146. STARPU_CALIBRATE=1 STARPU_SCHED="dm" $EXAMPLEDIR/dw_mult -nblocks 8 -x 8192 -y 8192 -z 8192 -pin >>$LOGFILE 2>&1
  147. save_cov "mult.dm";
  148. echo "mult.dmda"
  149. STARPU_CALIBRATE=1 STARPU_SCHED="dmda" $EXAMPLEDIR/dw_mult -nblocks 8 -x 8192 -y 8192 -z 8192 -pin >>$LOGFILE 2>&1
  150. save_cov "mult.dmda";
  151. }
  152. init;
  153. cd $BUILDDIR
  154. $ROOTDIR/configure --enable-coverage --prefix=$INSTALLDIR >>$LOGFILE 2>&1
  155. make clean >>$LOGFILE 2>&1
  156. make check
  157. make install -j >>$LOGFILE 2>&1
  158. apps;
  159. $ROOTDIR/configure --prefix=$INSTALLDIR --enable-coverage --enable-data-rw-lock
  160. make clean 1> /dev/null 2> /dev/null
  161. make check
  162. make install -j 1> /dev/null 2> log
  163. apps;
  164. generatehtml;
  165. echo
  166. echo "See $WORKDIR and $LOGFILE for detailed output"
  167. echo