1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
5 # Plots two lines, with min-max ranges, from two DYN.LCL.tbl files.
7 # The first three lines above let this script run without specifying the
8 # full path to perl, as long as it is in the user's PATH.
9 # Taken from perlrun man page.
11 $usage="usage: $0 <first .tbl> <second .tbl>\n";
14 ######## Process command line args.
16 while ( $#ARGV >= $[ && $ARGV[0] =~ /^-/ ) {
17 if ( $ARGV[0] eq '-?' ) {
21 print STDERR "$0: unknown option $ARGV[0]\n";
27 die "$usage" unless $#ARGV == 1;
32 ######## Plot separately for each number of suppliers.
38 my ($input, $suppliers, $output) = (@_);
40 open (INPUT, "$input") || die "$0: unable to open $input\n";
41 open (OUTPUT, "> $output") || die "$0: unable to open $output\n";
44 if (/^$suppliers (\d+) ([\d.]+) ([\d.]+) (\d+) (\d+)/) {
45 print OUTPUT "$1 $4 $2 $3\n";
55 my ($suppliers) = (@_);
57 &extract ("$tbl1", $suppliers, "tmpS$suppliers-rms");
58 &extract ("$tbl2", $suppliers, "tmpS$suppliers-muf");
60 open (GNUPLOT, "| gnuplot") || die "$0: unable to open gnuplot\n";
61 print GNUPLOT "set xlabel 'Number of Consumers'\n";
62 print GNUPLOT "set ylabel 'Latency, usec'\n";
63 print GNUPLOT "set terminal postscript eps color\n";
64 print GNUPLOT "set output 'DYN.plot-S$suppliers.eps'\n";
65 print GNUPLOT "plot " .
66 "'tmpS$suppliers-rms' title 'RMS' w lines, " .
67 "'tmpS$suppliers-rms' using (\$1-0.05):2:3:4 " .
68 "notitle w errorbars, " .
69 "'tmpS$suppliers-muf' title 'MUF' w lines, " .
70 "'tmpS$suppliers-muf' using (\$1+0.05):2:3:4 " .
71 "notitle w errorbars\n";
74 unlink "tmpS$suppliers-rms", "tmpS$suppliers-muf";