Skip to content

Commit

Permalink
rebuild/scripts: fix normalized map
Browse files Browse the repository at this point in the history
  • Loading branch information
lacombar committed Feb 18, 2012
1 parent 8c8eee8 commit 46f150d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 7 deletions.
38 changes: 37 additions & 1 deletion rebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,42 @@ set nomultiplot
EOF
}

generate_one_normalized_run_map()
{
local _script="$1"
local _image="$2"
local _data="$3"
local _max_ngroup="$4"
local _max_nloop="$5"
local _title="$6"

cat <<EOF > "${_script}"
set xrange [0:${_max_ngroup}]
set yrange [0:${_max_nloop}]
set terminal png size 800, 300
set output '${_image}'
set palette defined (-1 "#00bb00", -0.5 "#00bb00", 0 "#ffffff", 0.5 "#bb0000", 1 "#bb0000")
set cbrange [-1:1]
set title "${_title}"
set multiplot
set origin 0,0
set size 0.7,1
plot '${_data}' using 1:2:3 with image notitle
set noxtics
set noytics
set notitle
set origin 0.65,0.5
set size 0.35,0.5
set label 1 "variance" at 0,-150
plot '${_data}' using 1:2:4 with image notitle
set origin 0.65,0.0
set size 0.35,0.5
set label 1 "stddev"
plot '${_data}' using 1:2:5 with image notitle
set nomultiplot
EOF
}

generate_run_map()
{
local _ipc=$1; shift;
Expand Down Expand Up @@ -357,7 +393,7 @@ generate_run_map()
_script="scripts/${_ipc}-${_mode}-normalized.gplot"
_image="images/${_ipc}-${_mode}-normalized.png"

generate_one_run_map "${_script}" "${_image}" "${_data}" \
generate_one_normalized_run_map "${_script}" "${_image}" "${_data}" \
"${_max_ngroup}" "${_max_nloop}" "${_title}"

}
Expand Down
37 changes: 31 additions & 6 deletions scripts/diff-results.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,44 @@
@basedir = ARGV[0]
@targetdir = ARGV[1]

[ "process", "thread" ].each { |type|
base_fname = "#{@basedir}/data/#{type}"
target_fname = "#{@targetdir}/data/#{type}"
def do_diff(ipc, mode)
base_fname = "#{@basedir}/data/#{ipc}-#{mode}"
target_fname = "#{@targetdir}/data/#{ipc}-#{mode}"

base = File.open(base_fname)
target = File.open(target_fname)

output_fname = "#{@targetdir}/data/#{type}-normalized"
output_fname = "#{@targetdir}/data/#{ipc}-#{mode}-normalized"
output = File.open(output_fname, "w")

base.each_line { |line|
tline = target.gets
output.write "#{line.split[0]} #{line.split[1]} %.3f\n" % (tline.split[7].to_f / line.split[7].to_f)

avg_runtime = (tline.split[7].to_f / line.split[7].to_f) - 1
avg_runtime = 0.0 if avg_runtime.nan? or avg_runtime.infinite?

variance = (tline.split[8].to_f / line.split[8].to_f) - 1
variance = 0.0 if variance.nan? or variance.infinite?

stddev = (tline.split[9].to_f / line.split[9].to_f) - 1
stddev = 0.0 if stddev.nan? or stddev.infinite?

output.write "#{line.split[0]} #{line.split[1]} %.3f %.3f %.3f\n" %
[ avg_runtime, variance, stddev ]
}
end

def do_mode(ipc)
[ "process", "thread" ].each { |mode|
do_diff(ipc, mode)
}
end

def do_ipc()
[ "pipe", "socket" ].each { |ipc|
do_mode(ipc)
}
}
end

do_ipc()

0 comments on commit 46f150d

Please sign in to comment.