From 81163d3d4080d43d96ca6cf2cd5ec672812d9cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20W=C3=B3jtowicz?= Date: Tue, 24 May 2016 19:46:13 +0200 Subject: [PATCH] added init markdown generator --- .gitignore | 1 + results.Rmd | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 results.Rmd diff --git a/.gitignore b/.gitignore index 1c2691c..44e463e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ cpuinfo hosts-list.txt ssh/rsa.key *.rds +*.html diff --git a/results.Rmd b/results.Rmd new file mode 100644 index 0000000..264a63e --- /dev/null +++ b/results.Rmd @@ -0,0 +1,106 @@ +--- +title: "Results" +author: "Andrzej Wójtowicz" +output: html_document +--- + + +```{r, echo=FALSE, warning=FALSE, message=FALSE} +library(checkpoint) +checkpoint("2016-04-01", scanForPackages=FALSE, verbose=FALSE) +library(reshape2) +``` + +```{r, echo=FALSE} + +HOSTNAMES = suppressWarnings(readLines("hosts-list.txt")) + +BENCHMARKS = c("urbanek", + "revolution", + "gcbd") + +LIBRARIES = c("netlib", + "atlas_st", + "openblas", + "atlas_mt", + "gotoblas2", + "mkl", + "blis", + "cublas") + +HOST.INFO.PATTERN = "host-info-.log" +BENCHMKAR.PATTERN = "test---.rds" + +RESULTS.DIR = "results" + +``` + +```{r, echo=FALSE} + +hosts.info = data.frame(Host=character(), CPU=character(), GPU=character()) + +for (hostname in HOSTNAMES) +{ + fp = file.path(RESULTS.DIR, gsub("", hostname, HOST.INFO.PATTERN)) + + if (file.exists(fp)) + { + dr = readLines(fp) + dr = unname(sapply(dr, trimws)) + + hosts.info = rbind(hosts.info, + data.frame(Host= hostname, + CPU = dr[1], + GPU = ifelse(length(dr)==3, dr[3], NA))) + } +} + +benchmark.results = data.frame(Host=character(), Benchmark=character(), + Library=character(), Test=character(), + Runs=integer(), Size=integer(), + Time=numeric()) + +for (host in hosts.info$Host) +{ + for (benchmark in BENCHMARKS) + { + for (lib in LIBRARIES) + { + fp = file.path(RESULTS.DIR, gsub("", host, ( + gsub("", lib, ( + gsub("", benchmark, BENCHMKAR.PATTERN))))) + ) + + if (file.exists(fp)) + { + db = readRDS(fp) + + runs = NA + if (length(attr(db, "runs"))==1) { + runs = attr(db, "runs") + } else { + # gcbd + db = melt(cbind(db, runs=attr(db, "runs"), + size=attr(db, "size")), + id.vars=c("runs", "size"), + variable.name="name", + value.name="time") + runs = db$runs + } + + size = NA + if ("size" %in% colnames(db)) # gcbd + size = db$size + + benchmark.results = rbind(benchmark.results, + data.frame(Host=host, Benchmark=benchmark, + Library=lib, Test=db$name, + Runs=runs, Size=size, + Time=db$time)) + } + } + } +} + +``` +