Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multiple run averaging wrapper scripts.
Ben Bleything <ben@bleything.net>
- Loading branch information
Greg Smith
authored and
Greg Smith
committed
May 4, 2011
1 parent
481262a
commit 90d539c
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |