distrib.r 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # StarPU --- Runtime system for heterogeneous multicore architectures.
  2. #
  3. # Copyright (C) 2009-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. #
  5. # StarPU is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU Lesser General Public License as published by
  7. # the Free Software Foundation; either version 2.1 of the License, or (at
  8. # your option) any later version.
  9. #
  10. # StarPU is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. #
  14. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. #
  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)