#! /bin/sh # # generate run-time plot from bj.sh.log time results echo "Creating data/bj-run.txt and data/bj-run.gif" # 1066.83user 0.34system 17:51.56elapsed 99%CPU (0avgtext+0avgdata 398948maxresident)k # 4248.58user 0.66system 1:11:00elapsed 99%CPU (0avgtext+0avgdata 794228maxresident)k grep elapsed bj.sh.log | sed 's/elapsed//' | awk 'BEGIN { m = 8; } { n=split($3,a,/:/); # n should be 2 or 3 if( n == 2) t = a[1]*60+a[2]; else t = 60*(60*a[1]+a[2])+a[3]; print m, t; ++m; }' > data/bj-run.txt title="quantum simulation run-time vs. sample size" xlabel="number of qubits" ylabel="run-time (seconds)" labels="set logscale y\nset title \"$title\"\nset xlabel \"$xlabel\"\nset ylabel \"$ylabel\"" #labels="$labels\nset xrange [256:131072]" (printf "set term gif\nset output\n$labels\nplot '-' notitle with linespoints lc rgb 'blue'\n"; cat data/bj-run.txt) | gnuplot > data/bj-run.gif