From: Arnaud Giersch Date: Wed, 14 Sep 2011 13:21:21 +0000 (+0200) Subject: Add rc_{extract,normalize,usage}. X-Git-Tag: v0.1~9 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/b98275c59778b21716531d1e7246ccf4d8a7b09d?ds=inline Add rc_{extract,normalize,usage}. --- diff --git a/Experimentations/rc_extract b/Experimentations/rc_extract new file mode 100755 index 0000000..464e0c5 --- /dev/null +++ b/Experimentations/rc_extract @@ -0,0 +1,39 @@ +#!/bin/bash + +getval() { + zcat -f -- "$1" \ + | grep -e '^\[main/' \ + | awk ' + /\| Load/ { total_load = $(NF - 4); load_dev = $NF; next; } + /\| Computation/ { comp_sum = $(NF - 4); next; } + /\| Data send amount/ { data_sum = $(NF - 4); next; } + /\| Ctrl send count/ { ctrl_sum = $(NF - 4); next; } + /\| Total simulated time/ { duration = $NF; next; } + /caught CTRL-C/ { interrupted = 1; nextfile; } + /Simulation succeeded/ { success = 1; next; } + END{ + ok = success && !interrupted + if (ok) + print total_load, load_dev, comp_sum, + data_sum, ctrl_sum, duration; + else + print "n/a", "n/a", "n/a", "n/a", "n/a", "n/a" + exit (ok? 0: 1); + } + ' +} + +format='%-75s %6s %11s %11s %11s %11s %9s\n' +printf "$format" \ + "# Experimentation" \ + "Total" "Stddev" "Comput." \ + "Data amnt" "Ctrl mesg" "Duration" +for file; do + name=${file%%.gz} + name=${name%%.out} + if values=$(getval "$file"); then + printf "$format" "$name" $values + else + printf "$format" "#$name" $values + fi +done diff --git a/Experimentations/rc_normalize b/Experimentations/rc_normalize new file mode 100755 index 0000000..3ae4dfa --- /dev/null +++ b/Experimentations/rc_normalize @@ -0,0 +1,74 @@ +#!/usr/bin/gawk -f + +BEGIN { + # HARDCODED PARAMETERS + if (!load_per_node) { + load_per_node = 1000; # average load per node + printf "WARNING: Hardcoded load_per_node: %g\n", load_per_node > "/dev/stderr"; + } + if (!theo_dur) { + theo_dur = 10000.0; # theoretical time limit + printf "WARNING: Hardcoded theo_dur: %g\n", theo_dur > "/dev/stderr"; + } + if (!comp_factor) { + comp_factor = 1e6; # computing factor ( -c ) + printf "WARNING: Hardcoded comp_factor: %g\n", comp_factor > "/dev/stderr"; + } + if (!comm_factor) { + comm_factor = 1.25e5; # communication factor ( -C ) + printf "WARNING: Hardcoded comm_factor: %g\n", comm_factor > "/dev/stderr"; + printf " comm_factor will be adjusted by ratio from exp. name\n" > "/dev/stderr"; + adjust_comm_factor = 1; + } + if (!comp_power) { # average computing power per node + comp_power = 1e9; + printf "WARNING: Hardcoded comp_power: %g\n", comp_power > "/dev/stderr"; + } + + if (print_overhead) { + printf "%-75s %11s %11s %11s %14s %11s\n", "# Experimentation", + "Overhead", "Comput.(1)", "Comput.(2)", "Data amnt", "Stddev"; + } else { + printf "%-75s %11s %11s %14s %11s\n", "# Experimentation", + "Comput.(1)", "Comput.(2)", "Data amnt", "Stddev"; + } +} + +/^# Experiment/ { + next; +} + +/^#/ { + print; + next; +} + +{ + total_load = $2; + nodes = total_load / load_per_node; + stddev = 100.0 * $3 / load_per_node; + computed = $4; + real_dur = $7; + comp_cap = comp_power * nodes; + theo_comp = 100.0 * computed / (theo_dur * comp_cap); + real_comp = 100.0 * computed / (real_dur * comp_cap); + if (adjust_comm_factor) { + # find comp/comm ratio + split($1, tmp, "[_/:]") + ratio = tmp[4] / tmp[3] + real_comm_factor = comm_factor * ratio; + } else { + real_comm_factor = comm_factor; + } +# printf "# real_comm_factor: %g\n", real_comm_factor > "/dev/stderr"; + data_total = total_load * real_comm_factor; + data = $5 / data_total; + if (print_overhead) { + overhead = 100.0 * (real_dur / theo_dur - 1.0); + printf "%-75s %11.4f %11.4f %11.4f %14.4f %11.4f\n", + $1, overhead, theo_comp, real_comp, data, stddev; + } else { + printf "%-75s %11.4f %11.4f %14.4f %11.4f\n", + $1, theo_comp, real_comp, data, stddev; + } +} \ No newline at end of file diff --git a/Experimentations/rc_usage b/Experimentations/rc_usage new file mode 100644 index 0000000..2cde889 --- /dev/null +++ b/Experimentations/rc_usage @@ -0,0 +1,2 @@ +find results_hcube/ -type f -exec ./rc_extract {} \+ | ./rc_normalize -vcomm_factor=1e5 -vcomp_factor=1e8 -vtheo_dur=800 -vload_per_node=100 | sort +