model_distrib.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 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. create_histograms()
  18. {
  19. inputfile=$1
  20. R --no-save > /dev/null << EOF
  21. handle_hash <- function (hash)
  22. {
  23. val <- table[table[,1]==hash,3]
  24. # there is certainly a better way to do this !
  25. size <- unique(table[table[,1]==hash,2])
  26. pdf(paste("$inputfile", hash, size, "pdf", sep="."));
  27. h <- hist(val[val > quantile(val,0.01) & val<quantile(val,0.99)], col="red", breaks=50, density=10)
  28. }
  29. table <- read.table("$inputfile")
  30. hashlist <- unique(table[,1])
  31. for (hash in hashlist)
  32. {
  33. print(hash)
  34. handle_hash(hash)
  35. }
  36. EOF
  37. }
  38. for inputfile in $@
  39. do
  40. create_histograms $inputfile
  41. done