]> AND Private Git Repository - loba-papers.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Add method draw2.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 4 Mar 2013 22:33:03 +0000 (23:33 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 4 Mar 2013 22:33:03 +0000 (23:33 +0100)
I'll think about it... tomorrow.

supercomp11/data/script.r

index 9694aba5fc9b72843f4768d3b36b148c3e8b5784..3440b86ebe9f81b77a8a942f9ec8fab041f28b8b 100644 (file)
@@ -63,7 +63,7 @@ draw <- function(dset = ds,
 
   ## draw the time axis on the left
   axis(2, labels=TRUE)
-  mtext("Time (s)", side=2, line=2.5)
+  mtext("Simulated Time (s)", side=2, line=2.5)
 
   title(xlab="Algorithms")
 
@@ -87,13 +87,58 @@ draw <- function(dset = ds,
   mtext("Data amount (relative)", side=4, line=2.5)
 
   ## finally, set title
-  t <- paste0(dset$Mode[1], dset$Distrib[1], " / ", dset$Ratio[1], " / ",
+  t <- paste0(dset$Mode[1], dset$Distrib[1], " / ",
+              dset$Ratio[1], " / ",
               dset$Platform[1], " / ", dset$Topo[1])
   title(main=t)
 
   ## restore the graphical parameters
   par(p)
 
+  return(dset)
+}
+
+draw2 <- function(dset) {
+  ## Extract useful data
+  x.1 <- data.frame(Algo=dset$Algo, Size=dset$Size,
+                    Idle_avg=dset$Idle_avg,
+                    Conv_avg=dset$Conv_avg,
+                    Conv_max=dset$Conv_max)
+
+  ## Reshape data -> wide
+  x.2 <- reshape(x.1, direction="wide", idvar="Algo", timevar="Size")
+
+  ## Rename rows
+  rownames(x.2) <- x.2$Algo
+  #colnames(x.2) <- sub("^[^.]*\\.", "", colnames(x.2))
+
+  ## Remove first column ("Algo")
+  x.3 <- as.matrix(x.2[-1])
+
+  x.4 <- x.3[, c(FALSE,FALSE,TRUE)]
+  barplot(x.4, beside=TRUE,
+          names.arg=sub("^[^.]*\\.", "", colnames(x.4)),
+          col=rainbow(nrow(x.3), s=.5))
+
+  x.4 <- x.3[, c(FALSE,TRUE,FALSE)]
+  barplot(x.4, beside=TRUE,
+          axes=FALSE, axisnames=FALSE, add=TRUE,
+          legend.text=TRUE,
+          col=rainbow(nrow(x.3)))
+
+  x.4 <- x.3[, c(TRUE,FALSE,FALSE)]
+  barplot(x.4, beside=TRUE,
+          axes=FALSE, axisnames=FALSE, add=TRUE,
+          col=rainbow(nrow(x.3), v=.5))
+
+  ## finally, set titles
+  t <- paste0(dset$Mode[1], dset$Distrib[1], " / ",
+              dset$Ratio[1], " / ",
+              dset$Platform[1], " / ", dset$Topo[1])
+  title(xlab="Platform Size",
+        ylab="Simulated Time (s)",
+        main=t)
+
 }
 
 msg <- function(text,
@@ -104,10 +149,21 @@ msg <- function(text,
 }
 
 msg("First test, with algorithms \"plain\"...", wait = FALSE);
-draw(subset(ds, grepl("[lt]_plain", Algo)))
+xx <- draw(subset(ds, grepl("[lt]_plain", Algo)),
+           draw_distrib="N")
+
+msg("... with draw2()...")
+draw2(xx)
 
 msg("Second test, with algorithms \"bookkeeping\"...");
-draw(subset(ds, grepl("[lt]_bookkeeping", Algo)))
+xx <- draw(subset(ds, grepl("[lt]_bookkeeping", Algo)),
+           draw_distrib="N")
+
+msg("... with draw2()...")
+draw2(xx)
 
 msg("Third test, with all algorithms...");
-draw()
+xx <- draw(draw_distrib="N")
+
+msg("... with draw2()...")
+draw2(xx)