Ian Goldberg 6 miesięcy temu
rodzic
commit
fd2976d5f8
2 zmienionych plików z 152 dodań i 44 usunięć
  1. 0 44
      Docker/repro
  2. 152 0
      repro/repro

+ 0 - 44
Docker/repro

@@ -1,44 +0,0 @@
-#!/bin/bash
-LOGSUFFIX="wan10"
-logfile="16.out${LOGSUFFIX}"
-./run-experiment 16 >> $logfile
-
-echo "16";
-
-logfile="18.out${LOGSUFFIX}"
-./run-experiment 18 >> $logfile
-
-echo "18";
-
-logfile="20.out${LOGSUFFIX}"
-./run-experiment 20 >> $logfile
-
-echo "20";
-
-logfile="22.out${LOGSUFFIX}"
-./run-experiment 22 >> $logfile
-
-echo "22";
-
-logfile="24.out${LOGSUFFIX}"
-./run-experiment 24 >> $logfile
-
-echo "24";
-
-logfile="26.out${LOGSUFFIX}"
-./run-experiment 26 >> $logfile
-
-echo "26";
-
-logfile="28.out${LOGSUFFIX}"
-./run-experiment 28 >> $logfile
-
-echo "28";
-
-logfile="30.out${LOGSUFFIX}"
-./run-experiment 30 >> $logfile
-
-echo "30";
-
-logfile="32.out${LOGSUFFIX}"
-./run-experiment 32 >> $logfile

+ 152 - 0
repro/repro

@@ -0,0 +1,152 @@
+#!/bin/bash
+
+# Reproduce the Ramen 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
+
+# If the PRAC NUMA commands are set, but Ramen-specific ones are not,
+# use them for Ramen.
+if [ "$RAMEN_NUMA_P0" == "" -a "$PRAC_NUMA_P0" != "" ]; then
+    export RAMEN_NUMA_P0="$PRAC_NUMA_P0"
+fi
+if [ "$RAMEN_NUMA_P1" == "" -a "$PRAC_NUMA_P1" != "" ]; then
+    export RAMEN_NUMA_P1="$PRAC_NUMA_P1"
+fi
+if [ "$RAMEN_NUMA_P2" == "" -a "$PRAC_NUMA_P2" != "" ]; then
+    export RAMEN_NUMA_P2="$PRAC_NUMA_P2"
+fi
+
+# Allow running only subsets of the experiment suite.  Valid values are
+# "test", "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 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
+
+# Run one experiment
+# Arguments:
+# $1: depth (the ORAM has 2^depth elements)
+# $2: number of operations (e.g., 20)
+run() {
+    now=`date`
+    echo "$now: Running $1 $2 ..."
+    logfile="ramen_${1}_${2}.out${LOGSUFFIX}"
+    mkdir -p data
+    ../Docker/run-experiment $1 $2 >> data/$logfile
+}
+
+# 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 [ "$RAMEN_PARSE_HOST" = "1" ]; then
+        ./parse_logs $*
+    else
+        cat $* | docker exec -w /root/ramen/repro -i ramen_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..."
+    run 16 1
+    echo
+    echo "# Test output"
+    echo
+    parse data/ramen_16_1.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" = "all" ]; then
+    echo "Running experiments..."
+    # Figure 6(a)
+    ./generate_raw_data_reads_const_db.sh ${numiters}
+    # Figures 6(b) and 6(c)
+    ./generate_raw_data_reads.sh ${numiters}
+    # Figure 7(a)
+    ./generate_raw_data_bs_const_db.sh ${numiters}
+    # Figures 7(b) and 7(c)
+    ./generate_raw_data_bs.sh ${numiters}
+    # Figure 8(a)
+    ./generate_raw_data_heap_const_db.sh ${numiters}
+    # Figures 8(b) and 8(c)
+    ./generate_raw_data_heap.sh ${numiters}
+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/ramen.dat
+
+echo
+echo "# Figure 6(a)"
+egrep 'Ramen read 20 (16|32|64|128|256|512|1024|2048) .* s$' data/ramen.dat | sort -k4 -n
+echo
+echo "# Figure 6(b)"
+egrep 'Ramen read ([0-9]+) 10 .* s$' data/ramen.dat | sort -k3 -n
+echo
+echo "# Figure 6(c)"
+egrep 'Ramen read ([0-9]+) 10 .* KiB$' data/ramen.dat | sort -k3 -n
+echo
+echo "# Figure 7(a)"
+egrep 'Ramen read 20 (80|160|320|640|1280) .* s$' data/ramen.dat | sort -k4 -n
+echo
+echo "# Figure 7(b)"
+egrep 'Ramen read ([0-9]+) \1 .* s$' data/ramen.dat | sort -k3 -n
+echo
+echo "# Figure 7(c)"
+egrep 'Ramen read ([0-9]+) \1 .* KiB$' data/ramen.dat | sort -k3 -n
+echo
+echo "# Figure 8(a)"
+egrep 'Ramen read 20 (480|960|1920|3840) .* s$' data/ramen.dat | sort -k4 -n
+echo
+echo "# Figure 8(b)"
+egrep 'Ramen read (16 96|18 108|20 120|22 132|24 144|26 156|28 168|30 180) .* s$' data/ramen.dat | sort -k3 -n
+echo
+echo "# Figure 8(c)"
+egrep 'Ramen read (16 96|18 108|20 120|22 132|24 144|26 156|28 168|30 180) .* KiB$' data/ramen.dat | sort -k3 -n
+echo
+echo "# End figures"
+
+fi