distrib.r 1.5 KB

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