Skip to content

Commit

Permalink
Add multiple run averaging wrapper scripts.
Browse files Browse the repository at this point in the history
Ben Bleything <ben@bleything.net>
  • Loading branch information
Greg Smith authored and Greg Smith committed May 4, 2011
1 parent 481262a commit 90d539c
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.rst
Expand Up @@ -320,6 +320,16 @@ If you have any hints, changes or improvements, please contact:

* Greg Smith greg@2ndQuadrant.com

Credits
=======

The sample results given in this file have benefitted from private
contributions all over the world. Most submissions ask to remain
anonymous.

The multiple run averaging programs were originally contributed by
Ben Bleything <ben@bleything.net>

License
=======

Expand Down
41 changes: 41 additions & 0 deletions multi-averager
@@ -0,0 +1,41 @@
#!/usr/bin/env ruby
# Take the output from runs genearated by multi-stream-scaling and
# plot an average of the values

module Enumerable
def sum
return self.inject(0) {|a,e| a + e.to_f }
end

def mean
return self.sum / self.size
end

def std_dev
return Math.sqrt( self.map {|n| (n - self.mean) ** 2 }.mean )
end

end

title = ARGV[0]
unless title
abort "Usage: #{$0} [report_name]"
end

results = {}

Dir[ "#{title}*" ].each do |file|
lines = IO.popen( "cat #{file} | ./stream-graph.py" ).readlines
lines.shift # remove header comment

lines.map {|l| l.split }.each do |cores, result|
results[ cores.to_i ] ||= []
results[ cores.to_i ] << result.to_f
end
end

puts "cores,avg,stddev"
results.sort_by {|k,v| k }.each do |cores, values|
puts [ cores, values.mean, values.std_dev ].join(",")
end

23 changes: 23 additions & 0 deletions multi-stream-scaling
@@ -0,0 +1,23 @@
#!/usr/bin/env ruby
# Run stream-scaling multiple times, saving each into
# an output file based on the input test_title
$stdout.sync = true

count, title = ARGV[0,2]
unless count and title
abort "Usage: #{$0} run_count test_title"
end

puts "Preparing..."
system "rm -f stream"

puts "Running warmup..."
system "./stream-scaling > /dev/null"

count.to_i.times do |run|
filename = "#{title}_run_#{run + 1}"

print "Starting stream-scaling run #{run + 1} of #{count}..."
system "./stream-scaling > #{filename}"
puts "multi-stream-scaling completed. Results written to #{filename}"
end

0 comments on commit 90d539c

Please sign in to comment.