Thread: [Assorted-commits] SF.net SVN: assorted: [465] numa-bench/trunk/tools
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-02-16 21:46:18
|
Revision: 465 http://assorted.svn.sourceforge.net/assorted/?rev=465&view=rev Author: yangzhang Date: 2008-02-16 13:46:24 -0800 (Sat, 16 Feb 2008) Log Message: ----------- moved to simple-build Added Paths: ----------- numa-bench/trunk/tools/build Removed Paths: ------------- numa-bench/trunk/tools/Makefile Deleted: numa-bench/trunk/tools/Makefile =================================================================== --- numa-bench/trunk/tools/Makefile 2008-02-16 21:44:10 UTC (rev 464) +++ numa-bench/trunk/tools/Makefile 2008-02-16 21:46:24 UTC (rev 465) @@ -1,12 +0,0 @@ -COMMONS := $(wildcard commons/*.scala) - -all: out/PlotHist.class - -out/PlotHist.class: PlotHist.scala $(COMMONS) - mkdir -p out - fsc -d out $^ - -clean: - rm -rf out - -.PHONY: clean Added: numa-bench/trunk/tools/build =================================================================== --- numa-bench/trunk/tools/build (rev 0) +++ numa-bench/trunk/tools/build 2008-02-16 21:46:24 UTC (rev 465) @@ -0,0 +1,3 @@ +plot-hist: + srcs: [PlotHist.scala] + mainclass: PlotHist This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-03-05 06:11:21
|
Revision: 603 http://assorted.svn.sourceforge.net/assorted/?rev=603&view=rev Author: yangzhang Date: 2008-03-04 22:11:23 -0800 (Tue, 04 Mar 2008) Log Message: ----------- updated; fixed to present throughput Modified Paths: -------------- numa-bench/trunk/tools/PlotHist.scala numa-bench/trunk/tools/plot-hist.bash Modified: numa-bench/trunk/tools/PlotHist.scala =================================================================== --- numa-bench/trunk/tools/PlotHist.scala 2008-03-05 06:10:46 UTC (rev 602) +++ numa-bench/trunk/tools/PlotHist.scala 2008-03-05 06:11:23 UTC (rev 603) @@ -1,8 +1,18 @@ import commons.Collections._ import commons.Control._ import commons.Io._ + import scala.util._ +import scala.collection.mutable.MultiMap + object PlotHist { + type ConfigDescrip = String + type WorkerId = Int + type Time = Int + type MeanTime = Int + type Throughput = Double + type NumWorkers = Int + def main(args: Array[String]) { // The input consists of header lines describing the experiment // configuration followed by body lines reporting the time measurements. @@ -10,31 +20,41 @@ // config. val lines = using (TextReader(Console.in)) (_.readLines.toArray) val runs = separateHeads(groupByHeaders(lines)(_ startsWith "config: ")) - val exps = multimap( + val exps: MultiMap[ConfigDescrip, Seq[(WorkerId, Time)]] = multimap( for ((config, lines) <- runs) yield { val pairs = for (line <- lines) yield { - val Seq(a,b) = line split ": " - (a.toInt, b.toInt) + try { + val Seq(a,b) = line split ": " + (a.toInt, b.toInt) + } catch { + case e: Exception => { Console.err println line; throw e } + } } (config.split(": ")(1), pairs) } ) + // For each config, aggregate the bodies together by finding the average of // all the measurements corresponding to the same core. - val graphs = for ((config, vs) <- exps) yield { - val vmap = multimap(vs flatMap (x=>x)) - val agg = for ((x,ys) <- vmap) yield (x,mean(ys.toArray)) - val arr = agg.toStream.toArray - Sorting quickSort arr - (config, arr) - } + val graphs: Iterable[(ConfigDescrip, Array[(WorkerId, MeanTime)])] = + for ((config, vs) <- exps) yield { + val vmap = multimap(vs flatMap (x=>x)) + val agg = for ((x,ys) <- vmap) yield (x, mean(ys.toArray)) + val arr = agg.toStream.toArray + Sorting quickSort arr + (config, arr) + } + // Also generate the scaling view of the data by grouping together by the // first numeric parameter (in this case, the number of cores). - val scaling = multimap( + val scaling: MultiMap[ConfigDescrip, (NumWorkers, Throughput)] = multimap( for ((config, points) <- graphs) yield { - val Seq(_, ncores, rest) = config split (" ", 3) - (rest, (ncores.toInt, Iterable.max(points map (_._2)))) + val attrmap = Map(pairs(config split " "): _*) + val Seq(_, nworkers, rest) = config split (" ", 3) + val maxTime = Iterable.max(points map (_._2)) + val tput = nworkers.toDouble * attrmap("opcount").toDouble / (maxTime / 1000.0) + (rest, (nworkers.toInt, tput)) } ) val scalingGraphs = for ((k,vs) <- scaling; if vs.size > 1) yield { @@ -42,6 +62,7 @@ Sorting quickSort arr (k, arr) } + // Prepare the plotting. val cmd = <p> set style data histogram @@ -64,21 +85,24 @@ } set style data linespoints { - // Generate the time and speedup plots varying ncores. + // Generate the time and speedup plots varying nworkers. for ((config, points) <- scalingGraphs) yield { <p> set title '{config}' + set xlabel 'worker count' + set ylabel 'throughput (ops/s)' set output 'graphs/{"scaling-" + spacedToHyphen(config)}.pdf' plot '-' {points map {case (a,b) => (a + " " + b)} mkString "\n"} e + set ylabel 'speedup' set output 'graphs/{"speedup-" + spacedToHyphen(config)}.pdf' plot '-' { val (_, base) = points(0) - points map {case (a,b) => (a + " " + (base.toDouble/b)) + points map {case (a,b) => (a + " " + (b/base.toDouble)) } mkString "\n"} e </p>.text Modified: numa-bench/trunk/tools/plot-hist.bash =================================================================== --- numa-bench/trunk/tools/plot-hist.bash 2008-03-05 06:10:46 UTC (rev 602) +++ numa-bench/trunk/tools/plot-hist.bash 2008-03-05 06:11:23 UTC (rev 603) @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -o errexit -o nounset make -s -egrep '^[[:digit:]]+: [[:digit:]]+|config' "$@" | scala -cp out PlotHist +egrep '^[[:digit:]]+: [[:digit:]]+|config' "$@" | out/plot-hist This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |