"Fossies" - the Fresh Open Source Software Archive

Member "NetPIPE-3.7.2/bin/gnuplot-netpipe.pl" (19 Aug 2010, 1522 Bytes) of package /linux/privat/old/NetPIPE-3.7.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "gnuplot-netpipe.pl" see the Fossies "Dox" file reference documentation.

    1 #!/usr/bin/env perl
    2 
    3 use strict;
    4 
    5 sub run_gnuplot {
    6     my ($str) = @_;
    7     open(G, "|gnuplot") || die "Can't open gnuplot";
    8     print "================================================================
    9 $str\n";
   10     print G $str;
   11     close(G);
   12 }
   13 
   14 #############################################################################
   15 # Plot netpipe bandwidths
   16 #############################################################################
   17 
   18 my $g = "set terminal pdf 
   19 set output 'netpipe-bandwidths.pdf'
   20 set title 'NetPIPE Bandwidth'
   21 set ylabel 'Bandwidth (Mbps)'
   22 set xlabel 'Message size (bytes)'
   23 set key inside left top vertical Right noreverse enhanced autotitles columnhead nobox
   24 set style data linespoints
   25 
   26 set logscale y
   27 set logscale x
   28 
   29 plot ";
   30 my $first = 1;
   31 foreach my $a (@ARGV) {
   32     $g .= ", "
   33         if (!$first);
   34     $g .= "'$a' using 1:2 title '$a'";
   35     $first = 0;
   36 }
   37 
   38 run_gnuplot($g);
   39 
   40 #############################################################################
   41 # Plot netpipe latencies
   42 #############################################################################
   43 
   44 $g = "set terminal pdf 
   45 set output 'netpipe-latencies.pdf'
   46 set title 'NetPIPE Latencies'
   47 set ylabel 'Latency (us)'
   48 set xlabel 'Message size (bytes)'
   49 set key inside left top vertical Right noreverse enhanced autotitles columnhead nobox
   50 set style data linespoints
   51 
   52 set logscale y
   53 set logscale x
   54 
   55 plot ";
   56 $first = 1;
   57 foreach my $a (@ARGV) {
   58     $g .= ", "
   59         if (!$first);
   60     $g .= "'$a' using 1:3 title '$a'";
   61     $first = 0;
   62 }
   63 
   64 run_gnuplot($g);