heat.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008, 2009, 2010 Université de Bordeaux 1
  5. # Copyright (C) 2010 Centre National de la Recherche Scientifique
  6. #
  7. # StarPU is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU Lesser General Public License as published by
  9. # the Free Software Foundation; either version 2.1 of the License, or (at
  10. # your option) any later version.
  11. #
  12. # StarPU is distributed in the hope that it will be useful, but
  13. # WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. #
  16. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. DIR=$PWD
  18. ROOTDIR=$DIR/../..
  19. TIMINGDIR=$DIR/timings/
  20. mkdir -p $TIMINGDIR
  21. cd $ROOTDIR
  22. make clean 1> /dev/null 2> /dev/null
  23. make STARPU_ATLAS=1 CUDA=1 CPUS=4 1> /dev/null 2> /dev/null
  24. BLOCKS=8
  25. THETALIST="32 64 128 192 256 384"
  26. echo "absolute wall time ..."
  27. # perform all measurments first
  28. for theta in $THETALIST
  29. do
  30. size=$(($theta*32))
  31. for cpus in 0
  32. do
  33. for cublas in 1
  34. do
  35. blocks=$BLOCKS
  36. filename=$TIMINGDIR/timing.$cpus.$cublas.$size.$blocks
  37. export STARPU_NCPUS=$cpus
  38. export STARPU_NCUDA=$cublas
  39. echo "size $size cpus $cpus cublas $cublas blocks $blocks"
  40. $ROOTDIR/examples/heat -nthick 34 -ntheta $(($theta+2)) -nblocks $BLOCKS 2>/dev/null| tee $filename
  41. done
  42. done
  43. for cpus in 1 2 3 4
  44. do
  45. for cublas in 0 1
  46. do
  47. blocks=$BLOCKS
  48. filename=$TIMINGDIR/timing.$cpus.$cublas.$size.$blocks
  49. export STARPU_NCPUS=$cpus
  50. export STARPU_NCUDA=$cublas
  51. echo "size $size cpus $cpus cublas $cublas blocks $blocks"
  52. $ROOTDIR/examples/heat -nthick 34 -ntheta $(($theta+2)) -nblocks $BLOCKS 2>/dev/null| tee $filename
  53. done
  54. done
  55. done
  56. # time
  57. rm -f $DIR/time
  58. for theta in $THETALIST
  59. do
  60. size=$(($theta*32))
  61. line=`cat $TIMINGDIR/timing.0.1.$size.$BLOCKS $TIMINGDIR/timing.4.0.$size.$BLOCKS $TIMINGDIR/timing.1.1.$size.$BLOCKS $TIMINGDIR/timing.3.1.$size.$BLOCKS $TIMINGDIR/timing.4.1.$size.$BLOCKS | tr '\n' '\t'`
  62. echo "$size $line" >> $DIR/time
  63. done
  64. echo "speedup ..."
  65. for blocks in 2 4 8 16 32
  66. do
  67. for theta in $THETALIST
  68. do
  69. size=$(($theta*32))
  70. export STARPU_NCPUS=4
  71. export STARPU_NCUDA=0
  72. echo "size $size cpus 4 cublas 0 blocks $blocks"
  73. filename=$TIMINGDIR/timing.4.0.$size.$blocks
  74. $ROOTDIR/examples/heat -nthick 34 -ntheta $(($theta+2)) -nblocks $blocks 2>/dev/null| tee $filename
  75. export STARPU_NCPUS=3
  76. export STARPU_NCUDA=1
  77. echo "size $size cpus 3 cublas 1 blocks $blocks"
  78. filename=$TIMINGDIR/timing.3.1.$size.$blocks
  79. $ROOTDIR/examples/heat -nthick 34 -ntheta $(($theta+2)) -nblocks $blocks 2>/dev/null| tee $filename
  80. done
  81. done
  82. # speedups
  83. for blocks in 2 4 8 16 32
  84. do
  85. rm -f $DIR/speedup.$blocks
  86. for theta in $THETALIST
  87. do
  88. size=$(($theta*32))
  89. echo "$size `cat $TIMINGDIR/timing.3.1.$size.$blocks` `cat $TIMINGDIR/timing.4.0.$size.$blocks`" >> $DIR/speedup.$blocks
  90. done
  91. done