Browse Source

Remove the repro directory from the main branch, and point to the popets-repro branch from the main branch's README

Ian Goldberg 2 months ago
parent
commit
114617031b
3 changed files with 12 additions and 1108 deletions
  1. 12 0
      README.md
  2. 0 638
      repro/parse_logs
  3. 0 470
      repro/repro

+ 12 - 0
README.md

@@ -6,6 +6,18 @@ Adithya Vadapalli, avadapalli@cse.iitk.ac.in
 
 PRAC implements three-party secure computation, with a particular focus on computations that require random access to memory.  Parties 0 and 1 are the computational peers, while party 2 is the server.  The server aids the computation, but generally does much less than the two computational peers.
 
+This work appeared in:
+
+Sajin Sasy, Adithya Vadapalli, Ian Goldberg. "PRAC: Round-Efficient 3-Party MPC for Dynamic Data Structures". Proceedings on Privacy Enhancing Technologies 2024(3).  [https://eprint.iacr.org/2023/1897](https://eprint.iacr.org/2023/1897).
+
+----------
+
+## Looking for the reproduction instructions?
+
+The reproduction instructions for the PoPETs paper are in [the README file](https://git-crysp.uwaterloo.ca/iang/prac/src/popets-repro/repro/README.md) in the [`repro` directory of the `popets-repro` branch](https://git-crysp.uwaterloo.ca/iang/prac/src/popets-repro/repro).
+
+----------
+
 The multi-party computation (MPC) makes use of _resources_, most notably multiplication triples and distributed point functions (DPFs).  These resources can be precomputed; they are independent of the values in the computation being performed, so you only need to know how many of each you'll need.
 
 PRAC has three _modes_:

+ 0 - 638
repro/parse_logs

@@ -1,638 +0,0 @@
-#!/usr/bin/perl
-
-# Parse the log output files of run-experiment
-# Send concatenated log files to stdin, or list them on the command
-# line.
-
-use strict;
-
-my $showmemusage = 0;
-my $netsetup = '';
-my %preproc_resources = ();
-my @preproc_seconds = (0, 0, 0);
-my @preproc_kib = (0, 0, 0);
-my @preproc_latencies = (0, 0, 0);
-my @preproc_mem_mib = (0, 0, 0);
-my %preproc_s_data = ();
-my %preproc_kib_data = ();
-my %preproc_latencies_data = ();
-my %preproc_P0mem_mib_data = ();
-my %preproc_P1mem_mib_data = ();
-my %preproc_P2mem_mib_data = ();
-my %online_s_data = ();
-my %online_kib_data = ();
-my %online_latencies_data = ();
-my %online_P0mem_mib_data = ();
-my %online_P1mem_mib_data = ();
-my %online_P2mem_mib_data = ();
-
-if ($ARGV[0] eq "-m") {
-    shift;
-    $showmemusage = 1;
-}
-
-while(<>) {
-    chomp;
-    if (/Network setup: (.*)/) {
-        $netsetup = "$1 ";
-        next;
-    }
-    if (/===== Running prac (.*)/) {
-        my $cmdline = $1;
-        if ($cmdline =~ /-[pa]/) {
-            &parse_preproc($cmdline);
-            next;
-        } elsif ($cmdline =~ /^-- read/) {
-            &parse_read($cmdline);
-        } elsif ($cmdline =~ /^-- b?bsearch/) {
-            &parse_bsearch($cmdline);
-        } elsif ($cmdline =~ /^-- heapsampler/) {
-            &parse_heapsampler($cmdline);
-        } elsif ($cmdline =~ /^-- heap/) {
-            &parse_heap($cmdline);
-        } elsif ($cmdline =~ /^-- avl/) {
-            &parse_avl($cmdline);
-        } else {
-            warn "Unknown cmdline: $cmdline\n";
-            while(<>) {
-                last if /===== End/;
-            }
-        }
-        %preproc_resources = ();
-        @preproc_seconds = (0, 0, 0);
-        @preproc_kib = (0, 0, 0);
-        @preproc_latencies = (0, 0, 0);
-        @preproc_mem_mib = (0, 0, 0);
-        next;
-    }
-}
-
-# Convert the data (in the form [n, sum, sum_squares]) to statistics (in
-# the form [mean, variance])
-my %preproc_s_stats = ();
-my %preproc_kib_stats = ();
-my %preproc_latencies_stats = ();
-my %preproc_P0mem_mib_stats = ();
-my %preproc_P1mem_mib_stats = ();
-my %preproc_P2mem_mib_stats = ();
-my %online_s_stats = ();
-my %online_kib_stats = ();
-my %online_latencies_stats = ();
-my %online_P0mem_mib_stats = ();
-my %online_P1mem_mib_stats = ();
-my %online_P2mem_mib_stats = ();
-&statsify(\%preproc_s_stats, \%preproc_s_data);
-&statsify(\%preproc_kib_stats, \%preproc_kib_data);
-&statsify(\%preproc_latencies_stats, \%preproc_latencies_data);
-&statsify(\%preproc_P0mem_mib_stats, \%preproc_P0mem_mib_data);
-&statsify(\%preproc_P1mem_mib_stats, \%preproc_P1mem_mib_data);
-&statsify(\%preproc_P2mem_mib_stats, \%preproc_P2mem_mib_data);
-&statsify(\%online_s_stats, \%online_s_data);
-&statsify(\%online_kib_stats, \%online_kib_data);
-&statsify(\%online_latencies_stats, \%online_latencies_data);
-&statsify(\%online_P0mem_mib_stats, \%online_P0mem_mib_data);
-&statsify(\%online_P1mem_mib_stats, \%online_P1mem_mib_data);
-&statsify(\%online_P2mem_mib_stats, \%online_P2mem_mib_data);
-
-# The total values are the sums of the preproc and online values
-my %total_s_stats = ();
-my %total_kib_stats = ();
-&sum_preproc_online(\%total_s_stats, \%preproc_s_stats, \%online_s_stats);
-&sum_preproc_online(\%total_kib_stats, \%preproc_kib_stats, \%online_kib_stats);
-
-# Output the data
-&output_stats(\%preproc_s_stats, "Preprc", "s");
-&output_stats(\%preproc_kib_stats, "Preprc", "KiB");
-&output_stats(\%preproc_latencies_stats, "Preprc", "latencies");
-if ($showmemusage) {
-    &output_stats(\%preproc_P0mem_mib_stats, "Preprc", "P0MemMiB");
-    &output_stats(\%preproc_P1mem_mib_stats, "Preprc", "P1MemMiB");
-    &output_stats(\%preproc_P2mem_mib_stats, "Preprc", "P2MemMiB");
-}
-&output_stats(\%online_s_stats, "Onln", "s");
-&output_stats(\%online_kib_stats, "Onln", "KiB");
-&output_stats(\%online_latencies_stats, "Onln", "latencies");
-if ($showmemusage) {
-    &output_stats(\%online_P0mem_mib_stats, "Onln", "P0MemMiB");
-    &output_stats(\%online_P1mem_mib_stats, "Onln", "P1MemMiB");
-    &output_stats(\%online_P2mem_mib_stats, "Onln", "P2MemMiB");
-}
-&output_stats(\%total_s_stats, "Totl", "s");
-&output_stats(\%total_kib_stats, "Totl", "KiB");
-
-# Subroutines
-
-sub parse_preproc {
-    my $cmdline = $_[0];
-    my $who = 0;
-    # Reset the preproc usages unless we're appending to a previous
-    # preproc
-    unless ($cmdline =~ /-a/) {
-        %preproc_resources = ();
-        @preproc_seconds = (0, 0, 0);
-        @preproc_kib = (0, 0, 0);
-        @preproc_latencies = (0, 0, 0);
-        @preproc_mem_mib = (0, 0, 0);
-    }
-    &parse_resources(\%preproc_resources, $cmdline);
-    while(<>) {
-        if (/===== P([012]) output/) {
-            $who = $1;
-            next;
-        }
-        last if /===== End/;
-        # Try to recover from a malformed log
-        last if /^Max MB:/;
-        # It was too malformed
-        die "Malformed log" if /===== Running/;
-        if (/^(\d+) message bytes sent/) {
-            $preproc_kib[$who] += $1 / 1024;
-        } elsif (/^(\d+) Lamport clock/) {
-            $preproc_latencies[$who] += $1;
-        } elsif (/^(\d+) milliseconds? wall clock/) {
-            $preproc_seconds[$who] += $1 / 1000;
-        } elsif (/^Mem: (\d+) KiB/) {
-            $preproc_mem_mib[$who] += $1 / 1024;
-        }
-    }
-}
-
-# Parse a resource usage string, and accumulate the values into the
-# given dict
-sub parse_resources {
-    my ($dict, $resstr) = @_;
-    while ($resstr =~ /(\S+):(\d+)/g) {
-        $dict->{$1} = 0 unless defined $dict->{$1};
-        $dict->{$1} += $2;
-    }
-}
-
-# Serialize a resource usage dict back into a canonical string
-sub serialize_resources {
-    my $dict = $_[0];
-    my $res = '';
-    my $k;
-    foreach $k (sort keys %$dict) {
-        if ($res ne '') {
-            $res .= ' ';
-        }
-        $res .= $k . ":" . $dict->{$k};
-    }
-    $res;
-}
-
-sub parse_read {
-    my $cmdline = $_[0];
-    my $who = 0;
-    my @online_seconds = (0, 0, 0);
-    my @online_kib = (0, 0, 0);
-    my @online_latencies = (0, 0, 0);
-    my @online_mem_mib = (0, 0, 0);
-
-    unless ($cmdline =~ /read (\d+) (\d+)/) {
-        die "Cannot parse read cmdline: $cmdline";
-    }
-    my ($size, $num) = ($1, $2);
-    while(<>) {
-        if (/===== P([012]) output/) {
-            $who = $1;
-            next;
-        }
-        last if /===== End/;
-        # Try to recover from a malformed log
-        last if /^Max MB:/;
-        # It was too malformed
-        die "Malformed log" if /===== Running/;
-        if (/^(\d+) message bytes sent/) {
-            $online_kib[$who] = $1 / 1024;
-        } elsif (/^(\d+) Lamport clock/) {
-            $online_latencies[$who] = $1;
-        } elsif (/^(\d+) milliseconds? wall clock/) {
-            $online_seconds[$who] = $1 / 1000;
-        } elsif (/^Mem: (\d+) KiB/) {
-            $online_mem_mib[$who] = $1 / 1024;
-        } elsif ($who == 0 && /^Precomputed values used: (.*)/) {
-            my %used_resources = ();
-            &parse_resources(\%used_resources, $1);
-            my $preproc_resources_str = &serialize_resources(\%preproc_resources);
-            my $used_resources_str = &serialize_resources(\%used_resources);
-            if ($preproc_resources_str ne $used_resources_str) {
-                warn "Resource usage does not match preprocessing:\n" .
-                    "Preproc: $preproc_resources_str\n" .
-                    "Used: $used_resources_str\n ";
-            }
-        }
-    }
-    my $label = "PRAC read $netsetup$size $num";
-    &accum_data(\%preproc_s_data, $label, &maxarray(@preproc_seconds));
-    &accum_data(\%preproc_kib_data, $label, &avgarray(@preproc_kib));
-    &accum_data(\%preproc_latencies_data, $label, &maxarray(@preproc_latencies));
-    &accum_data(\%preproc_P0mem_mib_data, $label, $preproc_mem_mib[0]);
-    &accum_data(\%preproc_P1mem_mib_data, $label, $preproc_mem_mib[1]);
-    &accum_data(\%preproc_P2mem_mib_data, $label, $preproc_mem_mib[2]);
-    &accum_data(\%online_s_data, $label, &maxarray(@online_seconds));
-    &accum_data(\%online_kib_data, $label, &avgarray(@online_kib));
-    &accum_data(\%online_latencies_data, $label, &maxarray(@online_latencies));
-    &accum_data(\%online_P0mem_mib_data, $label, $online_mem_mib[0]);
-    &accum_data(\%online_P1mem_mib_data, $label, $online_mem_mib[1]);
-    &accum_data(\%online_P2mem_mib_data, $label, $online_mem_mib[2]);
-}
-
-sub parse_bsearch {
-    my $cmdline = $_[0];
-    my $optimized = "Opt";
-    if ($cmdline =~ /bbsearch/) {
-        $optimized = "Basic";
-    }
-    my $who = 0;
-    my $section = '';
-    my @online_seconds = (0, 0, 0);
-    my @online_kib = (0, 0, 0);
-    my @online_latencies = (0, 0, 0);
-    my @online_mem_mib = (0, 0, 0);
-
-    unless ($cmdline =~ /b?bsearch (\d+) (\d+)/) {
-        die "Cannot parse bsearch cmdline: $cmdline";
-    }
-    my ($size, $num) = ($1, $2);
-    while(<>) {
-        if (/===== P([012]) output/) {
-            $who = $1;
-            next;
-        }
-        if (/===== ([A-Z ]+) =====/) {
-            $section = $1;
-            next;
-        }
-        last if /===== End/;
-        # Try to recover from a malformed log
-        last if /^Max MB:/;
-        # It was too malformed
-        die "Malformed log" if /===== Running/;
-        if ($section eq "BINARY SEARCH") {
-            if (/^(\d+) message bytes sent/) {
-                $online_kib[$who] = $1 / 1024;
-            } elsif (/^(\d+) Lamport clock/) {
-                $online_latencies[$who] = $1;
-            } elsif (/^(\d+) milliseconds? wall clock/) {
-                $online_seconds[$who] = $1 / 1000;
-            } elsif (/^Mem: (\d+) KiB/) {
-                $online_mem_mib[$who] = $1 / 1024;
-            }
-        }
-        if ($who == 0 && /^Precomputed values used: (.*)/) {
-            my %used_resources = ();
-            &parse_resources(\%used_resources, $1);
-            my $preproc_resources_str = &serialize_resources(\%preproc_resources);
-            my $used_resources_str = &serialize_resources(\%used_resources);
-            if ($preproc_resources_str ne $used_resources_str) {
-                warn "Resource usage does not match preprocessing:\n" .
-                    "Preproc: $preproc_resources_str\n" .
-                    "Used: $used_resources_str\n ";
-            }
-        }
-    }
-    my $label = "${optimized}PRAC bsearch $netsetup$size $num";
-    &accum_data(\%preproc_s_data, $label, &maxarray(@preproc_seconds));
-    &accum_data(\%preproc_kib_data, $label, &avgarray(@preproc_kib));
-    &accum_data(\%preproc_latencies_data, $label, &maxarray(@preproc_latencies));
-    &accum_data(\%preproc_P0mem_mib_data, $label, $preproc_mem_mib[0]);
-    &accum_data(\%preproc_P1mem_mib_data, $label, $preproc_mem_mib[1]);
-    &accum_data(\%preproc_P2mem_mib_data, $label, $preproc_mem_mib[2]);
-    &accum_data(\%online_s_data, $label, &maxarray(@online_seconds));
-    &accum_data(\%online_kib_data, $label, &avgarray(@online_kib));
-    &accum_data(\%online_latencies_data, $label, &maxarray(@online_latencies));
-    &accum_data(\%online_P0mem_mib_data, $label, $online_mem_mib[0]);
-    &accum_data(\%online_P1mem_mib_data, $label, $online_mem_mib[1]);
-    &accum_data(\%online_P2mem_mib_data, $label, $online_mem_mib[2]);
-}
-
-sub parse_heap {
-    my $cmdline = $_[0];
-    my $who = 0;
-    my $section = '';
-    my @online_seconds = (0, 0, 0);
-    my @online_kib = (0, 0, 0);
-    my @online_latencies = (0, 0, 0);
-    my @online_mem_mib = (0, 0, 0);
-
-    my $optimized = "Opt";
-    my $oper = "";
-    unless ($cmdline =~ /heap -m (\d+) -d \d+ -i (\d+) -e (\d+) -opt (\d+) -s 0/) {
-        die "Cannot parse heap cmdline: $cmdline";
-    }
-    my ($size, $nins, $next, $optflag) = ($1, $2, $3, $4);
-    if ($nins > 0 && $next > 0) {
-        die "heap does both insertions and extractions: $cmdline\n";
-    }
-    $oper = "Ins" if $nins > 0;
-    $oper = "Ext" if $next > 0;
-    if ($optflag == 0) {
-        $optimized = "Basic";
-    }
-    my $num = ($nins + $next);
-    while(<>) {
-        if (/===== P([012]) output/) {
-            $who = $1;
-            next;
-        }
-        if (/===== ([A-Za-z ]+) Stats =====/) {
-            $section = $1;
-            next;
-        }
-        last if /===== End/;
-        # Try to recover from a malformed log
-        last if /^Max MB:/;
-        # It was too malformed
-        die "Malformed log" if /===== Running/;
-        my $rightsection = 0;
-        if ($section eq "Insert" && $oper eq "Ins") {
-            $rightsection = 1;
-        }
-        if ($section eq "Extract Min" && $oper eq "Ext") {
-            $rightsection = 1;
-        }
-        if ($rightsection) {
-            if (/^(\d+) message bytes sent/) {
-                $online_kib[$who] = $1 / 1024;
-            } elsif (/^(\d+) Lamport clock/) {
-                $online_latencies[$who] = $1;
-            } elsif (/^(\d+) milliseconds? wall clock/) {
-                $online_seconds[$who] = $1 / 1000;
-            } elsif (/^Mem: (\d+) KiB/) {
-                $online_mem_mib[$who] = $1 / 1024;
-            }
-        }
-        if ($who == 0 && /^Precomputed values used: (.*)/) {
-            my %used_resources = ();
-            &parse_resources(\%used_resources, $1);
-            my $preproc_resources_str = &serialize_resources(\%preproc_resources);
-            my $used_resources_str = &serialize_resources(\%used_resources);
-            if ($preproc_resources_str ne $used_resources_str) {
-                warn "Resource usage does not match preprocessing:\n" .
-                    "Preproc: $preproc_resources_str\n" .
-                    "Used: $used_resources_str\n ";
-            }
-        }
-    }
-    my $label = "${optimized}PRAC heap$oper $netsetup$size $num";
-    &accum_data(\%preproc_s_data, $label, &maxarray(@preproc_seconds));
-    &accum_data(\%preproc_kib_data, $label, &avgarray(@preproc_kib));
-    &accum_data(\%preproc_latencies_data, $label, &maxarray(@preproc_latencies));
-    &accum_data(\%preproc_P0mem_mib_data, $label, $preproc_mem_mib[0]);
-    &accum_data(\%preproc_P1mem_mib_data, $label, $preproc_mem_mib[1]);
-    &accum_data(\%preproc_P2mem_mib_data, $label, $preproc_mem_mib[2]);
-    &accum_data(\%online_s_data, $label, &maxarray(@online_seconds));
-    &accum_data(\%online_kib_data, $label, &avgarray(@online_kib));
-    &accum_data(\%online_latencies_data, $label, &maxarray(@online_latencies));
-    &accum_data(\%online_P0mem_mib_data, $label, $online_mem_mib[0]);
-    &accum_data(\%online_P1mem_mib_data, $label, $online_mem_mib[1]);
-    &accum_data(\%online_P2mem_mib_data, $label, $online_mem_mib[2]);
-}
-
-sub parse_avl {
-    my $cmdline = $_[0];
-    my $who = 0;
-    my $section = '';
-    my @online_seconds = (0, 0, 0);
-    my @online_kib = (0, 0, 0);
-    my @online_latencies = (0, 0, 0);
-    my @online_mem_mib = (0, 0, 0);
-
-    my $optimized = "Opt";
-    my $oper = "";
-    unless ($cmdline =~ /avl -m (\d+) -i (\d+) -e (\d+) -opt (\d+) -s 0/) {
-        die "Cannot parse heap cmdline: $cmdline";
-    }
-    my ($size, $nins, $ndel, $optflag) = ($1, $2, $3, $4);
-    if ($nins > 0 && $ndel > 0) {
-        die "avl does both insertions and deletions: $cmdline\n";
-    }
-    $oper = "Ins" if $nins > 0;
-    $oper = "Del" if $ndel > 0;
-    if ($optflag == 0) {
-        $optimized = "Basic";
-    }
-    my $num = ($nins + $ndel);
-
-    while(<>) {
-        if (/===== P([012]) output/) {
-            $who = $1;
-            next;
-        }
-        if (/===== ([A-Z ]+) =====/) {
-            $section = $1;
-            next;
-        }
-        last if /===== End/;
-        # Try to recover from a malformed log
-        last if /^Max MB:/;
-        # It was too malformed
-        die "Malformed log" if /===== Running/;
-        my $rightsection = 0;
-        if ($section eq "INSERTS" && $oper eq "Ins") {
-            $rightsection = 1;
-        }
-        if ($section eq "DELETES" && $oper eq "Del") {
-            $rightsection = 1;
-        }
-        if ($rightsection) {
-            if (/^(\d+) message bytes sent/) {
-                $online_kib[$who] = $1 / 1024;
-            } elsif (/^(\d+) Lamport clock/) {
-                $online_latencies[$who] = $1;
-            } elsif (/^(\d+) milliseconds? wall clock/) {
-                $online_seconds[$who] = $1 / 1000;
-            } elsif (/^Mem: (\d+) KiB/) {
-                $online_mem_mib[$who] = $1 / 1024;
-            }
-        }
-        if ($who == 0 && /^Precomputed values used: (.*)/) {
-            my %used_resources = ();
-            &parse_resources(\%used_resources, $1);
-            my $preproc_resources_str = &serialize_resources(\%preproc_resources);
-            my $used_resources_str = &serialize_resources(\%used_resources);
-            if ($preproc_resources_str ne $used_resources_str) {
-                warn "Resource usage does not match preprocessing:\n" .
-                    "Preproc: $preproc_resources_str\n" .
-                    "Used: $used_resources_str\n ";
-            }
-        }
-    }
-    my $label = "${optimized}PRAC avl$oper $netsetup$size $num";
-    &accum_data(\%preproc_s_data, $label, &maxarray(@preproc_seconds));
-    &accum_data(\%preproc_kib_data, $label, &avgarray(@preproc_kib));
-    &accum_data(\%preproc_latencies_data, $label, &maxarray(@preproc_latencies));
-    &accum_data(\%preproc_P0mem_mib_data, $label, $preproc_mem_mib[0]);
-    &accum_data(\%preproc_P1mem_mib_data, $label, $preproc_mem_mib[1]);
-    &accum_data(\%preproc_P2mem_mib_data, $label, $preproc_mem_mib[2]);
-    &accum_data(\%online_s_data, $label, &maxarray(@online_seconds));
-    &accum_data(\%online_kib_data, $label, &avgarray(@online_kib));
-    &accum_data(\%online_latencies_data, $label, &maxarray(@online_latencies));
-    &accum_data(\%online_P0mem_mib_data, $label, $online_mem_mib[0]);
-    &accum_data(\%online_P1mem_mib_data, $label, $online_mem_mib[1]);
-    &accum_data(\%online_P2mem_mib_data, $label, $online_mem_mib[2]);
-}
-
-sub parse_heapsampler {
-    my $cmdline = $_[0];
-    my $who = 0;
-    my $section = '';
-    my @online_seconds = (0, 0, 0);
-    my @online_kib = (0, 0, 0);
-    my @online_latencies = (0, 0, 0);
-    my @online_mem_mib = (0, 0, 0);
-
-    unless ($cmdline =~ /heapsampler (\d+) (\d+)/) {
-        die "Cannot parse heapsampler cmdline: $cmdline";
-    }
-    my ($num, $size) = ($1, $2);
-    while(<>) {
-        if (/===== P([012]) output/) {
-            $who = $1;
-            next;
-        }
-        if (/===== ([A-Z ]+) =====/) {
-            $section = $1;
-            next;
-        }
-        last if /===== End/;
-        # Try to recover from a malformed log
-        last if /^Max MB:/;
-        # It was too malformed
-        die "Malformed log" if /===== Running/;
-        if ($section eq "STREAMING") {
-            if (/^(\d+) message bytes sent/) {
-                $online_kib[$who] = $1 / 1024;
-            } elsif (/^(\d+) Lamport clock/) {
-                $online_latencies[$who] = $1;
-            } elsif (/^(\d+) milliseconds? wall clock/) {
-                $online_seconds[$who] = $1 / 1000;
-            } elsif (/^Mem: (\d+) KiB/) {
-                $online_mem_mib[$who] = $1 / 1024;
-            }
-        }
-        if ($who == 0 && /^Precomputed values used: (.*)/) {
-            my %used_resources = ();
-            &parse_resources(\%used_resources, $1);
-            my $preproc_resources_str = &serialize_resources(\%preproc_resources);
-            my $used_resources_str = &serialize_resources(\%used_resources);
-            if ($preproc_resources_str ne $used_resources_str) {
-                warn "Resource usage does not match preprocessing:\n" .
-                    "Preproc: $preproc_resources_str\n" .
-                    "Used: $used_resources_str\n ";
-            }
-        }
-    }
-    my $label = "PRAC heapsampler $netsetup$size $num";
-    &accum_data(\%preproc_s_data, $label, &maxarray(@preproc_seconds));
-    &accum_data(\%preproc_kib_data, $label, &avgarray(@preproc_kib));
-    &accum_data(\%preproc_latencies_data, $label, &maxarray(@preproc_latencies));
-    &accum_data(\%preproc_P0mem_mib_data, $label, $preproc_mem_mib[0]);
-    &accum_data(\%preproc_P1mem_mib_data, $label, $preproc_mem_mib[1]);
-    &accum_data(\%preproc_P2mem_mib_data, $label, $preproc_mem_mib[2]);
-    &accum_data(\%online_s_data, $label, &maxarray(@online_seconds));
-    &accum_data(\%online_kib_data, $label, &avgarray(@online_kib));
-    &accum_data(\%online_latencies_data, $label, &maxarray(@online_latencies));
-    &accum_data(\%online_P0mem_mib_data, $label, $online_mem_mib[0]);
-    &accum_data(\%online_P1mem_mib_data, $label, $online_mem_mib[1]);
-    &accum_data(\%online_P2mem_mib_data, $label, $online_mem_mib[2]);
-}
-
-sub maxarray {
-    my $max = $_[0];
-    foreach (@_) {
-        $max = $_ if $_ > $max;
-    }
-    $max;
-}
-
-sub avgarray {
-    my $sum = 0;
-    my $n = 0;
-    foreach (@_) {
-        $sum += $_;
-        $n += 1;
-    }
-    $sum / $n;
-}
-
-# Pass:
-# - a reference to a dictionary
-# - the key into that dictionary
-# - the new data point
-# Data is stored in the dictionary as a triple (n, sum, sum_squares)
-sub accum_data {
-    my ($dict, $key, $data) = @_;
-    $dict->{$key} = [0, 0, 0] unless defined $dict->{$key};
-    $dict->{$key}->[0] += 1;
-    $dict->{$key}->[1] += $data;
-    $dict->{$key}->[2] += ($data * $data);
-}
-
-# Convert data (in the form [n, sum, sum_squares]) to statistics (in
-# the form [mean, variance])
-sub statsify {
-    my ($sdict, $ddict) = @_;
-    my $key;
-    foreach $key (keys %$ddict) {
-        my $data = $ddict->{$key};
-        my $n = $data->[0];
-        my $sum = $data->[1];
-        my $sumsq = $data->[2];
-        if ($n == 0) {
-            $sdict->{$key} = [undef, undef];
-        } elsif ($n == 1) {
-            $sdict->{$key} = [$sum, undef];
-        } else {
-            $sdict->{$key} = [$sum/$n, ($sumsq - ($sum*$sum/$n))/($n-1)];
-        }
-    }
-}
-
-# Turn a stat array [mean, variance] into a string to display
-sub statstr {
-    my $data = $_[0];
-    if (defined $data->[1]) {
-        my $mean = $data->[0];
-        my $stddev = $data->[1] > 0 ? sqrt($data->[1]) : 0;
-        return "$mean ± $stddev";
-    } elsif (defined $data->[0]) {
-        return $data->[0];
-    } else {
-        return "none"
-    }
-}
-
-# Sum two stat arrays
-sub statsum {
-    my ($data0, $data1) = @_;
-    if (defined $data0->[1] && defined $data1->[1]) {
-        return [$data0->[0] + $data1->[0], $data0->[1] + $data1->[1]];
-    } else {
-        return [$data0->[0] + $data1->[0], undef];
-    }
-}
-
-# Add the preproc and online stats to get the total stats
-sub sum_preproc_online {
-    my ($tdict, $pdict, $odict) = @_;
-    my $key;
-    foreach $key (keys %$pdict) {
-        if (defined $odict->{$key}) {
-            $tdict->{$key} = &statsum($pdict->{$key}, $odict->{$key});
-        }
-    }
-}
-
-# Output the stats in the given dictionary. Append $phase to the
-# protocol name, and add $units to the end.
-sub output_stats {
-    my ($dict, $phase, $units) = @_;
-    my $label;
-    foreach $label (sort keys %$dict) {
-        my $printlabel = $label;
-        $printlabel =~ s/PRAC/PRAC$phase/;
-        print $printlabel, " ", &statstr($dict->{$label}), " $units\n";
-    }
-}

+ 0 - 470
repro/repro

@@ -1,470 +0,0 @@
-#!/bin/bash
-
-# Reproduce the PRAC experiments from our paper:
-
-# Sajin Sasy, Adithya Vadapalli, Ian Goldberg. PRAC: Round-Efficient
-# 3-Party MPC for Dynamic Data Structures
-
-# cd into the directory containing this script (from the bash faq 028)
-if [[ $BASH_SOURCE = */* ]]; then
-  cd -- "${BASH_SOURCE%/*}/" || exit
-fi
-
-# Allow running only subsets of the experiment suite.  Valid values are
-# "test", "fig6", "fig7", "fig8", "fig9", "tab3", "tab4", "all", "none".
-# ("none" is useful if you just want to re-parse the output of existing
-# logs.)  You can also say "single" followed by all the arguments to
-# "run" (below) to run a single experiment; for example:
-# ./repro single read 20 1
-if [ "$1" = "" ]; then
-    whichexps="test"
-else
-    whichexps="$1"
-fi
-
-# The number of operations per run; the graphs in the paper use 3
-if [ "$whichexps" = "single" -o "$2" = "" ]; then
-    # If there's an explicit experiment on the command line, don't read
-    # the next argument as the number of operations.  $numops will be
-    # ignored, anyway, since it will be specified as part of the
-    # command.
-    numiters=3
-else
-    numiters="$2"
-fi
-
-# The maximum amount of memory to use (in GB).  Set the environment
-# variable PRAC_MAXGB to increase it beyond 16 (don't set it lower
-# than 16).  if you're using NUMA, where different parties don't all
-# share the same memory pool, then instead set:
-# - PRAC_P0_MAXGB to the max GB of memory to use in each NUMA node, if
-#   you have at least three NUMA nodes, and each player gets their own
-#   numa node
-# - PRAC_P02_MAXGB to the max GB of memory to use in each NUMA node, if
-#   you have two numa nodes, and P0 and P2 are in one, and P1 is in the
-#   other
-
-# P0 and P1 always use the same amount of memory.
-
-# For preprocessing, in the event the total memory usage exceeds 16GB,
-# P2's memory usage is no more than 1% of P0's.
-
-# There's about 5 MB overhead when preprocessing.
-
-if [ "$PRAC_P0_MAXGB" != "" ]; then
-    # Each party uses its own NUMA memory pool
-    max_preproc_p0_mb=$((PRAC_P0_MAXGB*1000-5))
-    max_mb=$((PRAC_P0_MAXGB*3000))
-elif [ "$PRAC_P02_MAXGB" != "" ]; then
-    # P0 and P2 share a NUMA memory pool, P1 gets its own
-    max_preproc_p0_mb=$((PRAC_P02_MAXGB*990-5))
-    max_mb=$((PRAC_P02_MAXGB*1990))
-elif [[ "$PRAC_MAXGB" != "" && "$PRAC_MAXGB" -gt 16 ]]; then
-    # All parties share one memory pool
-    max_preproc_p0_mb=$((PRAC_MAXGB*497-5))
-    max_mb=$((PRAC_MAXGB*1000))
-else
-    # Default to PRAC_MAXGB=16
-    export PRAC_MAXGB=16
-    max_preproc_p0_mb=$((PRAC_MAXGB*497-5))
-    max_mb=$((PRAC_MAXGB*1000))
-fi
-
-logname='log'
-
-# Run one experiment
-# The arguments are just the arguments to run-experiment
-run() {
-    now=`date`
-    echo "$now: Running $* ..."
-    logfile="prac_${logname}.out${LOGSUFFIX}"
-    mkdir -p data
-    echo "Max MB: $max_mb" >> data/$logfile
-    if [ "$PRAC_USE_SSH" = "1" ]; then
-        ../docker/run-experiment-ssh $* >> data/$logfile
-    else
-        ../docker/run-experiment $* >> data/$logfile
-    fi
-}
-
-# Run preprocessing, being careful to not exceed available memory. We
-# typically preprocess a bunch of small resources that will easily fit
-# in memory, as well as a number of instances of one large resource.  We
-# create the small resources and as many of the instances of the large
-# resource first we can (with -p), and then more batches of instances of
-# the large resource (with -a, which means to append the newly created
-# resources to the storage file, rather than overwriting old ones).
-
-# Arguments:
-# $1: a string (containing embedded whitespace) of the required small
-#     resources
-# $2: the mb required by P0 to create the small resources
-# $3: the name of the large resource
-# $4: the number of instances of the large resource we want
-# $5: the mb required by P0 to create one instance of the large resource
-preproc() {
-    small_mb=$2
-    large_left=$4
-    large_mb_each=$5
-    # the maximum number of instances of the large resource we can
-    # create along with the small ones
-    num_large=$(( (max_preproc_p0_mb-small_mb)/large_mb_each ))
-    if [ $num_large -gt $large_left ]; then
-        num_large=$large_left
-    fi
-    run -p $1 ${3}:${num_large}
-    large_left=$((large_left-num_large))
-    # the maximum number of instances of the large resource we can
-    # create in a batch on their own
-    max_large_batch=$((max_preproc_p0_mb/large_mb_each))
-    if [ $max_large_batch = 0 ]; then
-        echo "Not enough memory"
-        return
-    fi
-    while [ $large_left -gt 0 ]; do
-        num_large=$large_left
-        if [ $num_large -gt $max_large_batch ]; then
-            num_large=$max_large_batch
-        fi
-        run -a ${3}:${num_large}
-        large_left=$((large_left-num_large))
-    done
-}
-
-# The number of MB needed for P0 to create different kinds of resources
-# of different sizes
-declare -A rMB
-rMB=([16]=6 [17]=11 [18]=20 [19]=38 [20]=76 [21]=150 [22]=297 [23]=593 [24]=1182 [25]=2361 [26]=4720 [27]=9440 [28]=18876 [29]=37755 [30]=75500)
-declare -A r2MB
-r2MB=([16]=9 [18]=32 [20]=125 [22]=494 [24]=1970 [26]=7870 [28]=31470 [30]=125850)
-declare -A iMB
-iMB=([15]=4 [17]=12 [19]=41 [21]=152 [23]=595 [25]=2364 [27]=9441 [29]=37753)
-declare -A i3MB
-i3MB=([15]=6 [17]=20 [19]=72 [21]=286 [23]=968 [25]=3955 [27]=15800 [29]=62950)
-
-# Parse the output logs.  We run this in the docker in case you don't
-# have perl installed on the host.
-# Arguments: a list of logfiles
-parse() {
-    if [ "$PRAC_PARSE_HOST" = "1" ]; then
-        ./parse_logs $*
-    else
-        cat $* | docker exec -w /root/prac/repro -i ${PRAC_DOCKER_PREFIX}prac_p0 ./parse_logs
-    fi
-}
-
-# A very small kick-the-tires test to ensure everything compiled and
-# built properly
-if [ "$whichexps" = "test" ]; then
-    echo "Running test experiment..."
-    logname='test'
-    run -p r16:1
-    run read 16 1
-    echo
-    echo "# Test output"
-    echo
-    parse data/prac_test.out${LOGSUFFIX}
-    echo
-    echo "# End test output"
-    echo
-    exit
-fi
-
-# Be able to run a single experiment specified on the command line
-if [ "$whichexps" = "single" ]; then
-    echo "Running single experiment..."
-    shift
-    run $*
-    exit
-fi
-
-now=`date`
-echo "$now: Starting experiments"
-
-if [ "$whichexps" = "fig6" -o "$whichexps" = "all" ]; then
-    echo "Running Figure 6 experiments..."
-    for iter in $(seq 1 $numiters); do
-        # Figure 6(a)
-        logname='fig6a'
-        for num in 16 32 64 128 256 512 1024 2048; do
-            preproc "" 0 r20 $num 76
-            run read 20 $num
-        done
-        # Figure 6(b,c)
-        logname='fig6bc'
-        for size in 16 18 20 22 24 26 28 30; do
-            preproc "" 0 r${size} 10 ${rMB[$size]}
-            run read $size 10
-        done
-    done
-fi
-
-if [ "$whichexps" = "fig7" -o "$whichexps" = "all" ]; then
-    echo "Running Figure 7 experiments..."
-    for iter in $(seq 1 $numiters); do
-        # Figure 7(a)
-        logname='fig7a'
-        for num in 4 8 16 32 64; do
-            preproc "c:$((num*20))" 10 i19 $num 41
-            run bsearch 20 $num
-        done
-        for num in 4 8 16 32 64; do
-            preproc "m:$((num*20)) c:$((num*20))" 20 r20 $((num*20)) 76
-            run bbsearch 20 $num
-        done
-        # Figure 7(b,c)
-        logname='fig7bc'
-        for size in 16 18 20 22 24 26 28 30; do
-            preproc "c:${size}" 1 i$((size-1)) 1 ${iMB[$((size-1))]}
-            run bsearch $size 1
-        done
-        for size in 16 18 20 22 24 26 28 30; do
-            preproc "m:${size} c:${size}" 1 r${size} ${size} ${rMB[$size]}
-            run bbsearch $size 1
-        done
-    done
-fi
-
-if [ "$whichexps" = "fig8" -o "$whichexps" = "all" ]; then
-    echo "Running Figure 8 experiments..."
-    for iter in $(seq 1 $numiters); do
-        # Figure 8(a)
-        logname='fig8a'
-        for num in 4 8 16 32; do
-            preproc "m:$((num*57)) a:$(( (num*19+63)/64 )) s:$((num*18)) c:$((num*38))" 35 i19.3 ${num} 68
-            run heap -m 20 -d 20 -i 0 -e ${num} -opt 1 -s 0
-        done
-        for num in 4 8 16 32; do
-            preproc "m:$((num*57)) a:$(( (num*19+63)/64 )) s:$((num*18)) c:$((num*38))" 35 r20 $((num*108)) 76
-            run heap -m 20 -d 20 -i 0 -e ${num} -opt 0 -s 0
-        done
-        # Figure 8(b,c)
-        logname='fig8bc'
-        for size in 16 18 20 22 24 26 28 30; do
-            preproc "m:$((size*3-3)) a:1 s:$((size-2)) c:$((size*2-2))" 3 i$((size-1)).3 1 ${i3MB[$((size-1))]}
-            run heap -m ${size} -d ${size} -i 0 -e 1 -opt 1 -s 0
-        done
-        for size in 16 18 20 22 24 26 28 30; do
-            preproc "m:$((size*3-3)) a:1 s:$((size-2)) c:$((size*2-2))" 3 r${size} $((size*6-12)) ${rMB[$size]}
-            run heap -m ${size} -d ${size} -i 0 -e 1 -opt 0 -s 0
-        done
-    done
-fi
-
-if [ "$whichexps" = "tab3" -o "$whichexps" = "all" ]; then
-    echo "Running Table 3 experiments..."
-    for iter in $(seq 1 $numiters); do
-        # Table 3
-        logname='tab3'
-        for size in 16 20 24; do
-            run -p m:$((size*2-1)) r5:1 i4:1 c:5
-            run heap -m ${size} -d $((size-1)) -i 1 -e 0 -opt 1 -s 0
-            run -p m:$((size-1)) c:$((size-1))
-            run heap -m ${size} -d $((size-1)) -i 1 -e 0 -opt 0 -s 0
-        done
-    done
-fi
-
-if [ "$whichexps" = "tab4" -o "$whichexps" = "all" ]; then
-    echo "Running Table 4 experiments..."
-    for iter in $(seq 1 $numiters); do
-        # Table 4
-        logname='tab4'
-        preproc "a:8 s:171 c:50" 3 r17 28 ${rMB[17]}
-        run avl -m 16 -i 1 -e 0 -opt 1 -s 0
-        preproc "a:10 s:201 c:60" 3 r21 33 ${rMB[21]}
-        run avl -m 20 -i 1 -e 0 -opt 1 -s 0
-        preproc "a:12 s:237 c:72" 3 r25 39 ${rMB[25]}
-        run avl -m 24 -i 1 -e 0 -opt 1 -s 0
-        preproc "m:1 a:30 s:867 r16.2:2 c:72" 26 r16 72 ${rMB[16]}
-        run avl -m 16 -i 0 -e 1 -opt 1 -s 0
-        preproc "m:1 a:36 s:1047 r20.2:2 c:87" 263 r20 87 ${rMB[20]}
-        run avl -m 20 -i 0 -e 1 -opt 1 -s 0
-        preproc "m:1 a:43 s:1263 r24.2:2 c:105" 3950 r24 105 ${rMB[24]}
-        run avl -m 24 -i 0 -e 1 -opt 1 -s 0
-    done
-fi
-
-if [ "$whichexps" = "fig9" -o "$whichexps" = "all" ]; then
-    echo "Running Figure 9 experiments..."
-    for iter in $(seq 1 $numiters); do
-        # Table 4
-        logname='fig9'
-        run -p m:1033 h:7497 a:3 s:118 r1:1 r2:6 r3:57 i1:6 i2:57 i1.3:2 i2.3:4 i3.3:57 c:610
-        run heapsampler 64 10
-        run -p m:2121 h:15561 a:6 s:246 r1:1 r2:6 r3:121 i1:6 i2:121 i1.3:2 i2.3:4 i3.3:121 c:1250
-        run heapsampler 128 10
-        run -p m:4297 h:31689 a:12 s:502 r1:1 r2:6 r3:249 i1:6 i2:249 i1.3:2 i2.3:4 i3.3:249 c:2530
-        run heapsampler 256 10
-        run -p m:8649 h:63945 a:24 s:1014 r1:1 r2:6 r3:505 i1:6 i2:505 i1.3:2 i2.3:4 i3.3:505 c:5090
-        run heapsampler 512 10
-        run -p m:17353 h:128457 a:48 s:2038 r1:1 r2:6 r3:1017 i1:6 i2:1017 i1.3:2 i2.3:4 i3.3:1017 c:10210
-        run heapsampler 1024 10
-        run -p m:34761 h:257481 a:96 s:4086 r1:1 r2:6 r3:2041 i1:6 i2:2041 i1.3:2 i2.3:4 i3.3:2041 c:20450
-        run heapsampler 2048 10
-        run -p m:1278 h:6237 a:4 s:167 r1:1 r2:6 r3:57 i1:6 i2:57 i1.3:2 i2.3:4 i3.3:8 i4.3:49 c:708
-        run heapsampler 64 30
-        run -p m:2686 h:14301 a:8 s:359 r1:1 r2:6 r3:121 i1:6 i2:121 i1.3:2 i2.3:4 i3.3:8 i4.3:113 c:1476
-        run heapsampler 128 30
-        run -p m:5502 h:30429 a:16 s:743 r1:1 r2:6 r3:249 i1:6 i2:249 i1.3:2 i2.3:4 i3.3:8 i4.3:241 c:3012
-        run heapsampler 256 30
-        run -p m:11134 h:62685 a:32 s:1511 r1:1 r2:6 r3:505 i1:6 i2:505 i1.3:2 i2.3:4 i3.3:8 i4.3:497 c:6084
-        run heapsampler 512 30
-        run -p m:22398 h:127197 a:64 s:3047 r1:1 r2:6 r3:1017 i1:6 i2:1017 i1.3:2 i2.3:4 i3.3:8 i4.3:1009 c:12228
-        run heapsampler 1024 30
-        run -p m:44926 h:256221 a:128 s:6119 r1:1 r2:6 r3:2041 i1:6 i2:2041 i1.3:2 i2.3:4 i3.3:8 i4.3:2033 c:24516
-        run heapsampler 2048 30
-        run -p m:3496 h:9891 a:11 s:521 r1:1 r2:6 r3:121 i1:6 i2:121 i1.3:2 i2.3:4 i3.3:8 i4.3:16 i5.3:32 i6.3:65 c:1800
-        run heapsampler 128 100
-        run -p m:7592 h:26019 a:23 s:1161 r1:1 r2:6 r3:249 i1:6 i2:249 i1.3:2 i2.3:4 i3.3:8 i4.3:16 i5.3:32 i6.3:193 c:3848
-        run heapsampler 256 100
-        run -p m:15784 h:58275 a:47 s:2441 r1:1 r2:6 r3:505 i1:6 i2:505 i1.3:2 i2.3:4 i3.3:8 i4.3:16 i5.3:32 i6.3:449 c:7944
-        run heapsampler 512 100
-        run -p m:32168 h:122787 a:95 s:5001 r1:1 r2:6 r3:1017 i1:6 i2:1017 i1.3:2 i2.3:4 i3.3:8 i4.3:16 i5.3:32 i6.3:961 c:16136
-        run heapsampler 1024 100
-        run -p m:64936 h:251811 a:191 s:10121 r1:1 r2:6 r3:2041 i1:6 i2:2041 i1.3:2 i2.3:4 i3.3:8 i4.3:16 i5.3:32 i6.3:1985 c:32520
-        run heapsampler 2048 100
-        run -p m:18994 h:45675 a:57 s:3083 r1:1 r2:6 r3:120 r4:385 i1:6 i2:120 i3:385 i1.3:2 i2.3:4 i3.3:8 i4.3:16 i5.3:32 i6.3:64 i7.3:128 i8.3:257 c:9613
-        run heapsampler 512 300
-        run -p m:40498 h:110187 a:121 s:6667 r1:1 r2:6 r3:120 r4:897 i1:6 i2:120 i3:897 i1.3:2 i2.3:4 i3.3:8 i4.3:16 i5.3:32 i6.3:64 i7.3:128 i8.3:769 c:20365
-        run heapsampler 1024 300
-        run -p m:83506 h:239211 a:249 s:13835 r1:1 r2:6 r3:120 r4:1921 i1:6 i2:120 i3:1921 i1.3:2 i2.3:4 i3.3:8 i4.3:16 i5.3:32 i6.3:64 i7.3:128 i8.3:1793 c:41869
-        run heapsampler 2048 300
-    done
-fi
-
-now=`date`
-echo "$now: Experiments complete"
-
-# If you specified a custom log suffix, you're going to be parsing the
-# outputs differently.
-if [ "$LOGSUFFIX" = "" ]; then
-
-parse data/*.out > data/prac.dat
-
-echo
-echo "# Figure 6(a)"
-egrep 'PRACOnln read 20 (16|32|64|128|256|512|1024|2048) .* s$' data/prac.dat | sort -k4 -n
-echo
-egrep 'PRACTotl read 20 (16|32|64|128|256|512|1024|2048) .* s$' data/prac.dat | sort -k4 -n
-echo
-echo "# Figure 6(b)"
-egrep 'PRACOnln read ([0-9]+) 10 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'PRACTotl read ([0-9]+) 10 .* s$' data/prac.dat | sort -k3 -n
-echo
-echo "# Figure 6(c)"
-egrep 'PRACOnln read ([0-9]+) 10 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'PRACTotl read ([0-9]+) 10 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-echo "# Figure 7(a)"
-egrep 'BasicPRACOnln bsearch 20 (4|8|16|32|64) .* s$' data/prac.dat | sort -k4 -n
-echo
-egrep 'BasicPRACTotl bsearch 20 (4|8|16|32|64) .* s$' data/prac.dat | sort -k4 -n
-echo
-egrep 'OptPRACOnln bsearch 20 (4|8|16|32|64) .* s$' data/prac.dat | sort -k4 -n
-echo
-egrep 'OptPRACTotl bsearch 20 (4|8|16|32|64) .* s$' data/prac.dat | sort -k4 -n
-echo
-echo "# Figure 7(b)"
-egrep 'BasicPRACOnln bsearch ([0-9]+) 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACTotl bsearch ([0-9]+) 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln bsearch ([0-9]+) 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACTotl bsearch ([0-9]+) 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-echo "# Figure 7(c)"
-egrep 'BasicPRACOnln bsearch ([0-9]+) 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACTotl bsearch ([0-9]+) 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln bsearch ([0-9]+) 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACTotl bsearch ([0-9]+) 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-echo "# Figure 8(a)"
-egrep 'BasicPRACOnln heapExt 20 (4|8|16|32) .* s$' data/prac.dat | sort -k4 -n
-echo
-egrep 'BasicPRACTotl heapExt 20 (4|8|16|32) .* s$' data/prac.dat | sort -k4 -n
-echo
-egrep 'OptPRACOnln heapExt 20 (4|8|16|32) .* s$' data/prac.dat | sort -k4 -n
-echo
-egrep 'OptPRACTotl heapExt 20 (4|8|16|32) .* s$' data/prac.dat | sort -k4 -n
-echo
-echo "# Figure 8(b)"
-egrep 'BasicPRACOnln heapExt ([0-9]+) 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACTotl heapExt ([0-9]+) 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln heapExt ([0-9]+) 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACTotl heapExt ([0-9]+) 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-echo "# Figure 8(c)"
-egrep 'BasicPRACOnln heapExt ([0-9]+) 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACTotl heapExt ([0-9]+) 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln heapExt ([0-9]+) 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACTotl heapExt ([0-9]+) 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-echo "# Table 3"
-egrep 'BasicPRACPreprc heapIns [0-9]+ 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACOnln heapIns [0-9]+ 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACPreprc heapIns [0-9]+ 1 .* latencies$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACOnln heapIns [0-9]+ 1 .* latencies$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACPreprc heapIns [0-9]+ 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'BasicPRACOnln heapIns [0-9]+ 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACPreprc heapIns [0-9]+ 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln heapIns [0-9]+ 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACPreprc heapIns [0-9]+ 1 .* latencies$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln heapIns [0-9]+ 1 .* latencies$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACPreprc heapIns [0-9]+ 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln heapIns [0-9]+ 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-echo "# Table 4"
-egrep 'OptPRACPreprc avlIns [0-9]+ 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln avlIns [0-9]+ 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACPreprc avlIns [0-9]+ 1 .* latencies$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln avlIns [0-9]+ 1 .* latencies$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACPreprc avlIns [0-9]+ 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln avlIns [0-9]+ 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACPreprc avlDel [0-9]+ 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln avlDel [0-9]+ 1 .* s$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACPreprc avlDel [0-9]+ 1 .* latencies$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln avlDel [0-9]+ 1 .* latencies$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACPreprc avlDel [0-9]+ 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-egrep 'OptPRACOnln avlDel [0-9]+ 1 .* KiB$' data/prac.dat | sort -k3 -n
-echo
-echo '# Heap Sampler'
-egrep 'PRACTotl heapsampler [0-9]+ [0-9]+ .* s' data/prac.dat | sort -k3,3n -k4,4n
-echo
-echo "# End figures"
-
-fi