model_distrib.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. 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