heat.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2008-2011,2014 Université de Bordeaux
  5. # Copyright (C) 2010,2015,2017 CNRS
  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. #
  18. DIR=$PWD
  19. ROOTDIR=$DIR/../..
  20. TIMINGDIR=$DIR/timings/
  21. mkdir -p $TIMINGDIR
  22. cd $ROOTDIR
  23. make clean 1> /dev/null 2> /dev/null
  24. make STARPU_ATLAS=1 CUDA=1 CPUS=4 1> /dev/null 2> /dev/null
  25. BLOCKS=8
  26. THETALIST="32 64 128 192 256 384"
  27. echo "absolute wall time ..."
  28. # perform all measurments first
  29. for theta in $THETALIST
  30. do
  31. size=$(($theta*32))
  32. for cpus in 0
  33. do
  34. for cublas in 1
  35. do
  36. blocks=$BLOCKS
  37. filename=$TIMINGDIR/timing.$cpus.$cublas.$size.$blocks
  38. export STARPU_NCPUS=$cpus
  39. export STARPU_NCUDA=$cublas
  40. echo "size $size cpus $cpus cublas $cublas blocks $blocks"
  41. $ROOTDIR/examples/heat -nthick 34 -ntheta $(($theta+2)) -nblocks $BLOCKS 2>/dev/null| tee $filename
  42. done
  43. done
  44. for cpus in 1 2 3 4
  45. do
  46. for cublas in 0 1
  47. do
  48. blocks=$BLOCKS
  49. filename=$TIMINGDIR/timing.$cpus.$cublas.$size.$blocks
  50. export STARPU_NCPUS=$cpus
  51. export STARPU_NCUDA=$cublas
  52. echo "size $size cpus $cpus cublas $cublas blocks $blocks"
  53. $ROOTDIR/examples/heat -nthick 34 -ntheta $(($theta+2)) -nblocks $BLOCKS 2>/dev/null| tee $filename
  54. done
  55. done
  56. done
  57. # time
  58. rm -f $DIR/time
  59. for theta in $THETALIST
  60. do
  61. size=$(($theta*32))
  62. 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'`
  63. echo "$size $line" >> $DIR/time
  64. done
  65. echo "speedup ..."
  66. for blocks in 2 4 8 16 32
  67. do
  68. for theta in $THETALIST
  69. do
  70. size=$(($theta*32))
  71. export STARPU_NCPUS=4
  72. export STARPU_NCUDA=0
  73. echo "size $size cpus 4 cublas 0 blocks $blocks"
  74. filename=$TIMINGDIR/timing.4.0.$size.$blocks
  75. $ROOTDIR/examples/heat -nthick 34 -ntheta $(($theta+2)) -nblocks $blocks 2>/dev/null| tee $filename
  76. export STARPU_NCPUS=3
  77. export STARPU_NCUDA=1
  78. echo "size $size cpus 3 cublas 1 blocks $blocks"
  79. filename=$TIMINGDIR/timing.3.1.$size.$blocks
  80. $ROOTDIR/examples/heat -nthick 34 -ntheta $(($theta+2)) -nblocks $blocks 2>/dev/null| tee $filename
  81. done
  82. done
  83. # speedups
  84. for blocks in 2 4 8 16 32
  85. do
  86. rm -f $DIR/speedup.$blocks
  87. for theta in $THETALIST
  88. do
  89. size=$(($theta*32))
  90. echo "$size `cat $TIMINGDIR/timing.3.1.$size.$blocks` `cat $TIMINGDIR/timing.4.0.$size.$blocks`" >> $DIR/speedup.$blocks
  91. done
  92. done