File: gnuplot-netpipe.pl

package info (click to toggle)
netpipe 3.7.2-8
  • links: PTS
  • area: main
  • in suites: buster, sid
  • size: 1,188 kB
  • sloc: ansic: 7,588; makefile: 279; sh: 63; perl: 45; csh: 25
file content (64 lines) | stat: -rwxr-xr-x 1,522 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env perl

use strict;

sub run_gnuplot {
    my ($str) = @_;
    open(G, "|gnuplot") || die "Can't open gnuplot";
    print "================================================================
$str\n";
    print G $str;
    close(G);
}

#############################################################################
# Plot netpipe bandwidths
#############################################################################

my $g = "set terminal pdf 
set output 'netpipe-bandwidths.pdf'
set title 'NetPIPE Bandwidth'
set ylabel 'Bandwidth (Mbps)'
set xlabel 'Message size (bytes)'
set key inside left top vertical Right noreverse enhanced autotitles columnhead nobox
set style data linespoints

set logscale y
set logscale x

plot ";
my $first = 1;
foreach my $a (@ARGV) {
    $g .= ", "
        if (!$first);
    $g .= "'$a' using 1:2 title '$a'";
    $first = 0;
}

run_gnuplot($g);

#############################################################################
# Plot netpipe latencies
#############################################################################

$g = "set terminal pdf 
set output 'netpipe-latencies.pdf'
set title 'NetPIPE Latencies'
set ylabel 'Latency (us)'
set xlabel 'Message size (bytes)'
set key inside left top vertical Right noreverse enhanced autotitles columnhead nobox
set style data linespoints

set logscale y
set logscale x

plot ";
$first = 1;
foreach my $a (@ARGV) {
    $g .= ", "
        if (!$first);
    $g .= "'$a' using 1:3 title '$a'";
    $first = 0;
}

run_gnuplot($g);