distrib.r 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2010 Université de Bordeaux 1
  4. # Copyright (C) 2010, 2011 Centre National de la Recherche Scientifique
  5. #
  6. # StarPU 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. # StarPU 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. t<-read.table("output.update_block");
  17. plot.multi.dens <- function(s)
  18. {
  19. junk.x = NULL
  20. junk.y = NULL
  21. for(i in 1:length(s))
  22. {
  23. junk.x = c(junk.x, density(s[[i]])$x)
  24. junk.y = c(junk.y, density(s[[i]])$y)
  25. }
  26. xr <- range(junk.x)
  27. yr <- range(junk.y)
  28. plot(density(s[[1]]), xlim = xr, ylim = yr, main="")
  29. for(i in 1:length(s))
  30. {
  31. lines(density(s[[i]]), xlim = xr, ylim = yr, col = i)
  32. }
  33. }
  34. cpus <- seq(1, 8);
  35. per_cpu <- function(cpuid)
  36. {
  37. t[4][t[2] == cpuid];
  38. }
  39. density_cpu <- function(cpuid)
  40. {
  41. density(per_cpu(cpuid))
  42. }
  43. l <- list()
  44. leg <- c()
  45. for (cpu in 1:4)
  46. {
  47. l <- c(l, list(per_cpu(cpu)))
  48. leg <- c(leg, cpu)
  49. }
  50. library(Hmisc)
  51. plot.multi.dens( l);
  52. le <- largest.empty(per_cpu(0), per_cpu(1), 0.1, 0.1)
  53. legend(le,legend=leg, col=(1:8), lwd=2, lty = 1)