This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via 3c087bc86514356e196c0c212a1b042e92345b22 (commit)
from 0d702682088fb96aa01f803571948641123a9678 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3c087bc86514356e196c0c212a1b042e92345b22
Author: Dries Kimpe <dkimpe(a)mcs.anl.gov>
Date: Sat Sep 29 20:29:24 2012 -0500
Improve figures
- Added script and data for average of runs
- Adjusted graphs to show solid line average, point for runs
-----------------------------------------------------------------------
Summary of changes:
papers/conditional-write/figs/Makefile | 12 ++
papers/conditional-write/figs/calc_average.hs | 128 ++++++++++++++++++++
.../figs/cond-small-conflicts.plt | 5 +-
papers/conditional-write/figs/cond-small-rate.plt | 5 +-
papers/conditional-write/figs/cond-small.avg.dat | 6 +
papers/conditional-write/figs/conflicts.plt | 2 +-
.../figs/scale-512bins-conflicts.plt | 5 +-
.../conditional-write/figs/scale-512bins-rate.plt | 8 +-
.../conditional-write/figs/scale-512bins.avg.dat | 5 +
.../conditional-write/figs/scale-allbins-rate.plt | 8 +-
.../conditional-write/figs/scale-allbins.avg.dat | 5 +
11 files changed, 176 insertions(+), 13 deletions(-)
create mode 100644 papers/conditional-write/figs/calc_average.hs
create mode 100644 papers/conditional-write/figs/cond-small.avg.dat
create mode 100644 papers/conditional-write/figs/scale-512bins.avg.dat
create mode 100644 papers/conditional-write/figs/scale-allbins.avg.dat
Diff of changes:
diff --git a/papers/conditional-write/figs/Makefile b/papers/conditional-write/figs/Makefile
index 1c82fc3..f4fb836 100644
--- a/papers/conditional-write/figs/Makefile
+++ b/papers/conditional-write/figs/Makefile
@@ -7,9 +7,21 @@
%.pdf: %.svg
inkscape -A $@ $<
+%: %.hs
+ ghc $<
+
+%.avg.dat: %.dat calc_average
+ ./calc_average <$< >$@
+
+
+
all::
+AVGS=cond-small.dat scale-allbins.dat scale-512bins.dat
+
+all:: $(patsubst %.dat, %.avg.dat, $(AVGS))
+
FIGURES=$(patsubst %.plt, %.pdf, $(wildcard *.plt))
FIGURES+=cond-overview.pdf
diff --git a/papers/conditional-write/figs/calc_average.hs b/papers/conditional-write/figs/calc_average.hs
new file mode 100644
index 0000000..9a4bc4d
--- /dev/null
+++ b/papers/conditional-write/figs/calc_average.hs
@@ -0,0 +1,128 @@
+import System.IO
+import Data.List
+import Data.Char (isSpace)
+
+
+sumList all@(x:xs) [] = all
+sumList [] all@(x:xs) = all
+sumList all1@(x:xs) all2@(y:ys) = zipWith (+) all1 all2
+
+
+sumLists = foldr sumList []
+
+-- Take two lists; If the first argument is equal, return a list containing of the
+-- first argument followed by the sum of the corresponding arguments from the lists
+-- If not equal: return the second list
+updateItem :: (Num a, Eq a) => [a] -> (a,[[a]]) -> (Bool, (a,[[a]]))
+updateItem (x:xs) y@(y1,ys) | x == y1 = (True, (x,(xs:ys)))
+ | otherwise = (False, y)
+
+
+
+-- Fold function to apply updateItem to each element of a list, keeping track if
+-- we found the element.
+-- Take:
+-- a list of numbers : the line we're trying to update
+-- a list of numbers : the current line we're examining in the overall data
+-- the current accumulator: what we've processed so far
+-- and returns
+-- update accumulator
+doTransform :: (Num a, Eq a) => [a] -> (a,[[a]]) -> (Bool, [(a,[[a]])]) -> (Bool, [(a, [[a]])])
+doTransform searchitem curel accum@(sel,b) = (newval, updatedline:b)
+ where (found,updatedline) = updateItem searchitem curel
+ newval = sel || found
+
+
+-- gets a line and the accumulator, and returns (Bool, Acc)
+-- where Bool is true if Acc was updated, False if not
+-- updateAcc :: [a] -> [[a]] -> (Bool, [a])
+-- updateAcc a b = (True, b)
+updateAcc :: (Eq a, Num a) => [a] -> [(a,[[a]])] -> (Bool,[(a,[[a]])])
+updateAcc a b = foldr applyTransform (False,[]) b
+ where applyTransform = doTransform a
+
+
+-- Takes the new line and the accumulator, and adds or updates acc
+updateList a@(a1:as) b | updated == True = newlist
+ | otherwise = (a1,[as]) : b
+ where (updated, newlist) = updateAcc a b
+
+
+--- ====================
+--- Showing stuff
+--- ==================
+
+-- fold which takes last element as seed
+myFoldR func list = foldr func lastel remainder
+ where lastel = last list
+ remainder = init list
+
+myConcat:: [String] -> String -> String
+--myConcat a token = myFoldR addToken a
+-- where addToken a b = a ++ token ++ b
+
+myConcat lines sep = intercalate sep lines
+
+prettify :: (Num a, Show a) => [(a,[a])] -> String
+prettify input = (myConcat lines "\n") ++ "\n"
+ where
+ createLine a = myConcat (map show a) "\t"
+ flatten = map (\(a,b) -> a:b)
+ lines = map createLine (flatten input)
+
+
+-- Hack since I don't remember how to force an instance of a polymorphic
+-- function
+readNum :: String -> Double
+readNum = read
+
+
+-- Calculate average of items
+calcAverage (a,b) = (a, map (\a -> a/len) (sumLists b))
+ where len = fromIntegral ( length b)
+
+-- reduceRes :: (Eq a, Num a) => [(a,[[a]])] -> [(a,[a])]
+reduceRes list = map doReduce list
+ where doReduce = calcAverage
+
+--
+-- Cleanup the input a bit
+--
+removeComment :: String -> String
+removeComment (x:xs) | x == '#' = []
+ | otherwise = x:removeComment (xs)
+removeComment _ = []
+
+
+removeWhite :: String -> String
+removeWhite = f . f
+ where f = reverse . dropWhile isSpace
+
+
+filterComments:: [String] -> [String]
+filterComments = filter (not . null) . map (removeWhite . removeComment)
+
+
+--
+--
+--
+main :: IO ()
+main = do
+ let acc = []
+
+ input <- getContents
+ let splitlines = (filterComments . lines) input
+ let splitwords = map words splitlines
+ let makenum = map doNum splitwords
+ where doNum a = map readNum a
+
+ let acc = foldr updateList [] makenum
+ -- let acc = [0]
+
+ let sortedRes = sortBy compareHead acc
+ where compareHead (a1,_) (b1,_) = compare a1 b1
+
+ let reducedres = reduceRes sortedRes
+
+ putStr (prettify reducedres)
+ return ()
diff --git a/papers/conditional-write/figs/cond-small-conflicts.plt b/papers/conditional-write/figs/cond-small-conflicts.plt
index 26fde5b..83fc794 100644
--- a/papers/conditional-write/figs/cond-small-conflicts.plt
+++ b/papers/conditional-write/figs/cond-small-conflicts.plt
@@ -1,5 +1,5 @@
#set term po eps color solid "NimbusSanL-Regu" 16 fontfile "/usr/share/texmf-texlive/fonts/type1/urw/helvetic/uhvr8a.pfb"
-set term po eps color solid 16
+#set term po eps color solid 16
# color blindness work around
set style line 1 lc 1 lw 4
@@ -26,6 +26,7 @@ set rmargin 5
set xtics (1, 8, 16, 24, 32, "2^64" 55)
set xrange [0:60]
-plot "cond-small.dat" using 1:(100*($2/($2+$3))) notitle with linespoints
+plot "cond-small.dat" using 1:(100*($2/($2+$3))) notitle with points, \
+ "cond-small.avg.dat" using 1:(100*($2/($2+$3))) notitle with lines lc 1
#plot "< cat rand-un-read-ext4-vosd.dat |grep read" using 2:5 title "VOSD/ext4 (disk)" with points lt 1, \
diff --git a/papers/conditional-write/figs/cond-small-rate.plt b/papers/conditional-write/figs/cond-small-rate.plt
index ee9ffa5..40e33dc 100644
--- a/papers/conditional-write/figs/cond-small-rate.plt
+++ b/papers/conditional-write/figs/cond-small-rate.plt
@@ -1,5 +1,5 @@
#set term po eps color solid "NimbusSanL-Regu" 16 fontfile "/usr/share/texmf-texlive/fonts/type1/urw/helvetic/uhvr8a.pfb"
-set term po eps color solid 16
+#set term po eps color solid 16
# color blindness work around
set style line 1 lc 1 lw 4
@@ -26,6 +26,7 @@ set rmargin 5
set xtics (1, 8, 16, 24, 32, "2^64" 55)
set xrange [0:60]
-plot "cond-small.dat" using 1:4 notitle with linespoints
+#plot "cond-small.dat" using 1:4 notitle with linespoints
+plot "cond-small.dat" using 1:4 notitle with points, "cond-small.avg.dat" using 1:4 notitle with lines lc 1
#plot "< cat rand-un-read-ext4-vosd.dat |grep read" using 2:5 title "VOSD/ext4 (disk)" with points lt 1, \
diff --git a/papers/conditional-write/figs/cond-small.avg.dat b/papers/conditional-write/figs/cond-small.avg.dat
new file mode 100644
index 0000000..59d5823
--- /dev/null
+++ b/papers/conditional-write/figs/cond-small.avg.dat
@@ -0,0 +1,6 @@
+1.0 15000.0 125815.4 327.23269760000005
+8.0 60000.0 61147.6 1263.0694076
+16.0 150000.0 77729.4 1760.690236
+24.0 200000.0 68950.8 1879.2588284
+32.0 200000.0 51608.0 2117.4447472
+55.0 200000.0 0.0 2868.7762291999998
diff --git a/papers/conditional-write/figs/conflicts.plt b/papers/conditional-write/figs/conflicts.plt
index e3e4e16..79cbb63 100644
--- a/papers/conditional-write/figs/conflicts.plt
+++ b/papers/conditional-write/figs/conflicts.plt
@@ -1,4 +1,4 @@
-set term po eps color solid 16
+#set term po eps color solid 16
set output 'conflicts.eps'
set style data histogram
diff --git a/papers/conditional-write/figs/scale-512bins-conflicts.plt b/papers/conditional-write/figs/scale-512bins-conflicts.plt
index b09ea26..5cbf2d8 100644
--- a/papers/conditional-write/figs/scale-512bins-conflicts.plt
+++ b/papers/conditional-write/figs/scale-512bins-conflicts.plt
@@ -1,5 +1,5 @@
#set term po eps color solid "NimbusSanL-Regu" 16 fontfile "/usr/share/texmf-texlive/fonts/type1/urw/helvetic/uhvr8a.pfb"
-set term po eps color solid 16
+#set term po eps color solid 16
# color blindness work around
set style line 1 lc 1 lw 4
@@ -27,5 +27,6 @@ set xtics (1, 8, 16, 24, 32)
set xrange [0:33]
set yrange [0:100]
-plot "scale-512bins.dat" using 1:(100*($5/($5+$6))) notitle with linespoints
+plot "scale-512bins.dat" using 1:(100*($5/($5+$6))) notitle with points lc 1, \
+ "scale-512bins.avg.dat" using 1:(100*($5/($5+$6))) notitle with lines lc 1
diff --git a/papers/conditional-write/figs/scale-512bins-rate.plt b/papers/conditional-write/figs/scale-512bins-rate.plt
index 7f1cace..2fca1af 100644
--- a/papers/conditional-write/figs/scale-512bins-rate.plt
+++ b/papers/conditional-write/figs/scale-512bins-rate.plt
@@ -1,5 +1,5 @@
#set term po eps color solid "NimbusSanL-Regu" 16 fontfile "/usr/share/texmf-texlive/fonts/type1/urw/helvetic/uhvr8a.pfb"
-set term po eps color solid 16
+#set term po eps color solid 16
# color blindness work around
set style line 1 lc 1 lw 4
@@ -26,7 +26,9 @@ set rmargin 5
set xtics (1, 8, 16, 24, 32)
set xrange [0:33]
-plot "scale-512bins.dat" using 1:7 title "conditional updates" with linespoints, \
-"scale-512bins.dat" using 1:4 title "locked updates" with linespoints
+plot "scale-512bins.dat" using 1:7 notitle with points lc 1, \
+ "scale-512bins.avg.dat" using 1:7 title "conditional updates" with lines lc 1, \
+ "scale-512bins.dat" using 1:4 notitle with points lc 2, \
+ "scale-512bins.avg.dat" using 1:4 title "locked updates" with lines lc 2
#plot "< cat rand-un-read-ext4-vosd.dat |grep read" using 2:5 title "VOSD/ext4 (disk)" with points lt 1, \
diff --git a/papers/conditional-write/figs/scale-512bins.avg.dat b/papers/conditional-write/figs/scale-512bins.avg.dat
new file mode 100644
index 0000000..3f4d638
--- /dev/null
+++ b/papers/conditional-write/figs/scale-512bins.avg.dat
@@ -0,0 +1,5 @@
+1.0 20000.0 0.0 216.648131 70000.0 1072.2 2632.0612195999997
+8.0 56000.0 0.0 494.4213434 560000.0 72756.0 17653.119012599996
+16.0 64000.0 0.0 533.318144 800000.0 213456.0 30577.525495600003
+24.0 48000.0 0.0 519.2737402 960000.0 364413.4 34537.980198599995
+32.0 57600.0 0.0 534.3734866000001 960000.0 433940.2 9323.8588624
diff --git a/papers/conditional-write/figs/scale-allbins-rate.plt b/papers/conditional-write/figs/scale-allbins-rate.plt
index cc37057..d971fcf 100644
--- a/papers/conditional-write/figs/scale-allbins-rate.plt
+++ b/papers/conditional-write/figs/scale-allbins-rate.plt
@@ -1,5 +1,5 @@
#set term po eps color solid "NimbusSanL-Regu" 16 fontfile "/usr/share/texmf-texlive/fonts/type1/urw/helvetic/uhvr8a.pfb"
-set term po eps color solid 16
+#set term po eps color solid 16
# color blindness work around
set style line 1 lc 1 lw 4
@@ -26,7 +26,9 @@ set rmargin 5
set xtics (1, 8, 16, 24, 32)
set xrange [0:33]
-plot "scale-allbins.dat" using 1:7 title "conditional updates" with linespoints, \
-"scale-allbins.dat" using 1:4 title "locked updates" with linespoints
+plot "scale-allbins.dat" using 1:7 notitle with points lc 1, \
+ "scale-allbins.avg.dat" using 1:7 title "conditional updates" with lines lc 1, \
+ "scale-allbins.dat" using 1:4 notitle with points lc 2, \
+ "scale-allbins.dat" using 1:4 title "locked updates" with lines lc 2
#plot "< cat rand-un-read-ext4-vosd.dat |grep read" using 2:5 title "VOSD/ext4 (disk)" with points lt 1, \
diff --git a/papers/conditional-write/figs/scale-allbins.avg.dat b/papers/conditional-write/figs/scale-allbins.avg.dat
new file mode 100644
index 0000000..a6ec72f
--- /dev/null
+++ b/papers/conditional-write/figs/scale-allbins.avg.dat
@@ -0,0 +1,5 @@
+1.0 20000.0 0.0 216.58491200000003 20000.0 0.0 2711.1732736
+8.0 56000.0 0.0 491.6805944000001 3200000.0 0.0 21960.535207400004
+16.0 64000.0 0.0 522.1389048 6400000.0 0.0 41567.6530836
+24.0 48000.0 0.0 543.2123152 6000000.0 0.0 54053.664260599995
+32.0 57600.0 0.0 539.030164 8000000.0 0.0 78492.718312
hooks/post-receive
--