#!/bin/bash # This is the experiment that requires the most customization for your # hardware setup. Ideally, set BASE_DUORAM_NUMA_P{0,1} to numactl # commands that use as disjoint resources as possible (separate NUMA # nodes if you have them, separate CPUs if not, or just seprarate # physical cores if not). We'll set P2 to be the same as P0, since # P0/P1 and P2 don't do most of their work at the same time. # # The code will set the environment variables DUORAM_NUMA_P0, # DUORAM_NUMA_P1, and DUORAM_NUMA_P2 to use _subsets of the appropriate # size_ of the cores you specify here for each party. # e.g.: # You have at least two NUMA nodes, each with at least 32 cores: BASE_DUORAM_NUMA_P0="numactl -N 0 -m 0" BASE_DUORAM_NUMA_P1="numactl -N 1 -m 1" CORESLIST="4 8 16 32" # You have two 16-core CPUs (times 2 for hyperthreading); CPU 0 is cores # 0-15 and 32-47; CPU 1 is cores 16-31 and 48-63 # BASE_DUORAM_NUMA_P0="numactl -C 0-15,32-47" # BASE_DUORAM_NUMA_P1="numactl -C 16-31,48-63" # CORESLIST="4 8 16 32" # You have one 16-core CPU (times 2 for hyperthreading); you won't be # able to run the 32-core (for each party) test. # BASE_DUORAM_NUMA_P0="numactl -C 0-7,16-23" # BASE_DUORAM_NUMA_P1="numactl -C 8-15,24-31" # CORESLIST="4 8 16" # Hopefully you don't have to touch anything below here when # customizing. # If the first argument is "-n", don't actually run new experiments; # just output the logged results if [ "$1" = "-n" ]; then shift repro_scaling="echo" else repro_scaling="./repro scaling" fi # The number of operations to do numops=128 if [ "$1" != "" ]; then numops="$1" fi outputfile=$$.scaling.log cleanup() { rm -f $outputfile exit } trap cleanup EXIT SIGINT # Stop any running dockers ./stop-all-dockers for c in $CORESLIST; do echo echo "Using $c cores..." echo export DUORAM_NUMA_P0="$BASE_DUORAM_NUMA_P0 numactl -C +0-$((c-1))" export DUORAM_NUMA_P1="$BASE_DUORAM_NUMA_P1 numactl -C +0-$((c-1))" export DUORAM_NUMA_P2="$BASE_DUORAM_NUMA_P0 numactl -C +0-$((c-1))" export LOGSUFFIX=".${c}core" # Duoram echo echo Running Duoram repro echo ( cd ../Docker && echo "Starting Duoram dockers" && echo && \ ./start-docker && $repro_scaling $numops && \ cat read_30ms_100mbit_${numops}_*.out.${c}core | \ docker exec -w /root/duoram/Docker -i duoram_p0 ./parse_logs | \ egrep 'DuoramOnln read .*s$' | sed -e "s/30ms/${c} 30ms/" | \ sort -k4 -n && \ echo "Stopping Duoram dockers" && \ echo && ./stop-docker ) | tee -a $outputfile if [ ${PIPESTATUS[0]} != "0" ]; then exit 1 fi # Floram echo echo Running Floram repro echo ( cd floram-docker && echo "Starting Floram dockers" && echo && \ ./start-docker && $repro_scaling $numops && \ cat read_30ms_100mbit_${numops}.out.${c}core | \ docker exec -w /root -i floram_p0 ./parse_logs | \ egrep ' read .*s$' | sed -e "s/30ms/${c} 30ms/" | \ sort -k4 -n && \ echo "Stopping Floram dockers" && \ echo && ./stop-docker ) | tee -a $outputfile if [ ${PIPESTATUS[0]} != "0" ]; then exit 1 fi done echo echo "# Figure 10(a)" grep 'Floram read 16 ' $outputfile echo grep '2PDuoramOnln read 16 ' $outputfile echo grep '3PDuoramOnln read 16 ' $outputfile echo echo "# Figure 10(b)" grep 'Floram read 20 ' $outputfile echo grep '2PDuoramOnln read 20 ' $outputfile echo grep '3PDuoramOnln read 20 ' $outputfile echo echo "# Figure 10(c)" grep 'Floram read 26 ' $outputfile echo grep '2PDuoramOnln read 26 ' $outputfile echo grep '3PDuoramOnln read 26 ' $outputfile echo