diff --git a/libexec/scaling b/libexec/scaling index a2fd8a072..fff3d52d8 100755 --- a/libexec/scaling +++ b/libexec/scaling @@ -82,7 +82,7 @@ def table(benchmarks): for b in benchmarks: threads,benchmark = b[0],b[1] row = [threads] - for k in ['Event','Avg','Total','Orch','Services']: + for k in ['Avg','Total','Orch','Services']: if k in benchmark: if k == 'Services': row.extend(benchmark[k].values()) @@ -100,66 +100,6 @@ def save(benchmarks): for row in table(benchmarks): f.write(' '.join([str(x) for x in row])+'\n') -gnuplot=''' -set terminal qt size 1000,700 - -set multiplot layout 2,2 -set datafile columnheaders -set title font 'sans,14' -set key box -set xlabel 'Threads' -set ylabel 'Event Time [ms]' -set yrange [0:] - -set title 'I/O' -set key outside right width 2 -plot 'scaling.txt' \ - using 1:(($2*$1)) pt 7 with points title columnhead(2) ,\ - '' using 1:((column($#))) pt 7 with points title 'Total' ,\ - '' using 1:($6) pt 7 with points title 'Reader' ,\ - '' using 1:((column($#-1))) pt 7 with points title 'Writer' ,\ - '' using 1:(($6*$1)) pt 7 with points title 'IOver' ,\ - -set title 'Engines' - -# data-ai-uber.yml: -#plot 'scaling.txt' \ -# using 1:($7) pt 7 with points title columnhead(7) ,\ -# '' using 1:($8) pt 7 with points title columnhead(8) ,\ -# '' using 1:($9) pt 7 with points title columnhead(9) ,\ -# '' using 1:($10) pt 7 with points title columnhead(10) ,\ -# '' using 1:($11) pt 7 with points title columnhead(11) ,\ -# '' using 1:($12) pt 7 with points title columnhead(12) ,\ - -# rgd-clarode.yml: -plot 'scaling.txt' \ - using 1:($7) pt 7 with points title columnhead(7) ,\ - '' using 1:($14) pt 7 with points title columnhead(14) ,\ - '' using 1:($15) pt 7 with points title columnhead(15) ,\ - '' using 1:($16) pt 7 with points title columnhead(16) ,\ - '' using 1:($26) pt 9 with points title columnhead(26) ,\ - '' using 1:($19) pt 7 with points title columnhead(19) ,\ - '' using 1:($28) pt 9 with points title columnhead(28) ,\ - '' using 1:($33) pt 9 with points title columnhead(33) ,\ - -set title 'Throughput' -set ylabel 'Rate [Hz]' -set size 0.7,0.5 -set origin 0.12,0 -unset key -f(x) = m*x -fit [0:24] f(x) 'scaling.txt' using 1:(1/$2*1e3) via m -plot 'scaling.txt' using 1:(1/$2*1e3) pt 7, f(x) -''' - -def plot(): - import tempfile - with tempfile.NamedTemporaryFile(mode='w') as f: - f.write(gnuplot) - f.flush() - list(run(['gnuplot','-p',f.name])) - input() - if __name__ == '__main__': cfg = cli() if not cfg.P: @@ -168,5 +108,4 @@ if __name__ == '__main__': benchmarks.append([threads, benchmark(cfg, threads)]) show(benchmarks) save(benchmarks) - plot() diff --git a/libexec/scaling.gpl b/libexec/scaling.gpl index c858a734c..3d9228bfa 100644 --- a/libexec/scaling.gpl +++ b/libexec/scaling.gpl @@ -1,4 +1,17 @@ +# parse command line arguments: +datafile = 'scaling.txt' +if (ARGC > 0) { + if (ARGV[1] eq "-u") { + uberMode = 1 + if (ARGC > 1) { + datafile = ARGV[ARGC] + } + } else { + datafile = ARGV[ARGC] + } +} + set terminal svg size 1000,700 set multiplot layout 2,2 @@ -9,43 +22,66 @@ set xlabel 'Threads' set ylabel 'Event Time [ms]' set yrange [0:] -set title 'I/O' -set key outside right width 2 -plot 'scaling.txt' \ - using 1:(($2*$1)) pt 7 with points title columnhead(2) ,\ - '' using 1:((column($#))) pt 7 with points title 'Total' ,\ - '' using 1:($6) pt 7 with points title 'Reader' ,\ - '' using 1:((column($#-1))) pt 7 with points title 'Writer' ,\ - '' using 1:(($6*$1)) pt 7 with points title 'IOver' ,\ +set key outside top center horizontal +set size 0.4,0.5 +set origin 0.0,0.5 +plot datafile \ + using 1:((column($#))) pt 7 with points title 'Total' ,\ + '' using 1:($5) pt 9 with points title 'Reader' ,\ + '' using 1:((column($#-1))) pt 9 with points title 'Writer' ,\ + '' using 1:(($5*$1)) pt 7 with points title 'IOver' + #'' using 1:(($2*$1)) pt 7 with points title columnhead(2) +set size 0.6,1.0 +set origin 0.4,0.0 set title 'Engines' - -# data-ai-uber.yml: -#plot 'scaling.txt' \ -# using 1:($7) pt 7 with points title columnhead(7) ,\ -# '' using 1:($8) pt 7 with points title columnhead(8) ,\ -# '' using 1:($9) pt 7 with points title columnhead(9) ,\ -# '' using 1:($10) pt 7 with points title columnhead(10) ,\ -# '' using 1:($11) pt 7 with points title columnhead(11) ,\ -# '' using 1:($12) pt 7 with points title columnhead(12) ,\ - -# rgd-clarode.yml: -plot 'scaling.txt' \ +set key outside right vertical +if (exists("uberMode")) { + plot datafile \ using 1:($7) pt 7 with points title columnhead(7) ,\ - '' using 1:($14) pt 7 with points title columnhead(14) ,\ - '' using 1:($15) pt 7 with points title columnhead(15) ,\ - '' using 1:($16) pt 7 with points title columnhead(16) ,\ + '' using 1:($8) pt 7 with points title columnhead(8) ,\ + '' using 1:($9) pt 7 with points title columnhead(9) ,\ + '' using 1:($10) pt 7 with points title columnhead(10) ,\ + '' using 1:($11) pt 7 with points title columnhead(11) ,\ + '' using 1:($12) pt 7 with points title columnhead(12) ,\ +} else { + plot datafile \ + using 1:($6) pt 7 with points title columnhead(6) ,\ + '' using 1:($7) pt 7 with points title columnhead(7) ,\ + '' using 1:($8) pt 7 with points title columnhead(8) ,\ + '' using 1:($9) pt 7 with points title columnhead(9) ,\ + '' using 1:($10) pt 7 with points title columnhead(10) ,\ + '' using 1:($11) pt 7 with points title columnhead(11) ,\ + '' using 1:($12) pt 7 with points title columnhead(12) ,\ + '' using 1:($13) pt 7 with points title columnhead(13) ,\ + '' using 1:($14) pt 8 with points title columnhead(14) ,\ + '' using 1:($15) pt 8 with points title columnhead(15) ,\ + '' using 1:($16) pt 8 with points title columnhead(16) ,\ + '' using 1:($17) pt 8 with points title columnhead(17) ,\ + '' using 1:($18) pt 8 with points title columnhead(18) ,\ + '' using 1:($19) pt 8 with points title columnhead(19) ,\ + '' using 1:($20) pt 8 with points title columnhead(20) ,\ + '' using 1:($21) pt 8 with points title columnhead(21) ,\ + '' using 1:($22) pt 9 with points title columnhead(22) ,\ + '' using 1:($23) pt 9 with points title columnhead(23) ,\ + '' using 1:($24) pt 9 with points title columnhead(24) ,\ + '' using 1:($25) pt 9 with points title columnhead(25) ,\ '' using 1:($26) pt 9 with points title columnhead(26) ,\ - '' using 1:($19) pt 7 with points title columnhead(19) ,\ + '' using 1:($27) pt 9 with points title columnhead(27) ,\ '' using 1:($28) pt 9 with points title columnhead(28) ,\ - '' using 1:($33) pt 9 with points title columnhead(33) ,\ + '' using 1:($29) pt 9 with points title columnhead(29) ,\ + '' using 1:($30) pt 6 with points title columnhead(30) ,\ + '' using 1:($31) pt 6 with points title columnhead(31) ,\ + '' using 1:($32) pt 6 with points title columnhead(32) ,\ + '' using 1:($33) pt 6 with points title columnhead(33) +} set title 'Throughput' set ylabel 'Rate [Hz]' -set size 0.7,0.5 -set origin 0.12,0 +set size 0.4,0.5 +set origin 0,0 unset key f(x) = m*x -fit [0:24] f(x) 'scaling.txt' using 1:(1/$2*1e3) via m -plot 'scaling.txt' using 1:(1/$2*1e3) pt 7, f(x) +fit [0:24] f(x) datafile using 1:(1/$2*1e3) via m +plot datafile using 1:(1/$2*1e3) pt 7, f(x) diff --git a/libexec/taskset b/libexec/taskset new file mode 100755 index 000000000..e93ce6931 --- /dev/null +++ b/libexec/taskset @@ -0,0 +1,2 @@ +#!/bin/bash +echo $(numactl -H | grep "^node $1 cpus:" | awk '{for(i=4;i<=NF;++i)print$i}') | sed 's/ /,/g'