repro-scaling 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. #!/bin/bash
  2. # This is the experiment that requires the most customization for your
  3. # hardware setup. Ideally, set BASE_DUORAM_NUMA_P{0,1} to numactl
  4. # commands that use as disjoint resources as possible (separate NUMA
  5. # nodes if you have them, separate CPUs if not, or just seprarate
  6. # physical cores if not). We'll set P2 to be the same as P0, since
  7. # P0/P1 and P2 don't do most of their work at the same time.
  8. #
  9. # The code will set the environment variables DUORAM_NUMA_P0,
  10. # DUORAM_NUMA_P1, and DUORAM_NUMA_P2 to use _subsets of the appropriate
  11. # size_ of the cores you specify here for each party.
  12. # e.g.:
  13. # You have at least two NUMA nodes, each with at least 32 cores:
  14. BASE_DUORAM_NUMA_P0="numactl -N 0 -m 0"
  15. BASE_DUORAM_NUMA_P1="numactl -N 1 -m 1"
  16. CORESLIST="4 8 16 32"
  17. # You have two 16-core CPUs (times 2 for hyperthreading); CPU 0 is cores
  18. # 0-15 and 32-47; CPU 1 is cores 16-31 and 48-63
  19. # BASE_DUORAM_NUMA_P0="numactl -C 0-15,32-47"
  20. # BASE_DUORAM_NUMA_P1="numactl -C 16-31,48-63"
  21. # CORESLIST="4 8 16 32"
  22. # You have one 16-core CPU (times 2 for hyperthreading); you won't be
  23. # able to run the 32-core (for each party) test.
  24. # BASE_DUORAM_NUMA_P0="numactl -C 0-7,16-23"
  25. # BASE_DUORAM_NUMA_P1="numactl -C 8-15,24-31"
  26. # CORESLIST="4 8 16"
  27. # Hopefully you don't have to touch anything below here when
  28. # customizing.
  29. # If the first argument is "-n", don't actually run new experiments;
  30. # just output the logged results
  31. if [ "$1" = "-n" ]; then
  32. shift
  33. repro_scaling="echo"
  34. else
  35. repro_scaling="./repro scaling"
  36. fi
  37. # The number of operations to do
  38. numops=128
  39. if [ "$1" != "" ]; then
  40. numops="$1"
  41. fi
  42. outputfile=$$.scaling.log
  43. cleanup() {
  44. rm -f $outputfile
  45. exit
  46. }
  47. trap cleanup EXIT SIGINT
  48. # Stop any running dockers
  49. ./stop-all-dockers
  50. for c in $CORESLIST; do
  51. echo
  52. echo "Using $c cores..."
  53. echo
  54. export DUORAM_NUMA_P0="$BASE_DUORAM_NUMA_P0 numactl -C +0-$((c-1))"
  55. export DUORAM_NUMA_P1="$BASE_DUORAM_NUMA_P1 numactl -C +0-$((c-1))"
  56. export DUORAM_NUMA_P2="$BASE_DUORAM_NUMA_P0 numactl -C +0-$((c-1))"
  57. export LOGSUFFIX=".${c}core"
  58. # Duoram
  59. echo
  60. echo Running Duoram repro
  61. echo
  62. ( cd ../Docker && echo "Starting Duoram dockers" && echo && \
  63. ./start-docker && $repro_scaling $numops && \
  64. cat read_30ms_100mbit_${numops}_*.out.${c}core | \
  65. docker exec -w /root/duoram/Docker -i duoram_p0 ./parse_logs | \
  66. egrep 'DuoramOnln read .*s$' | sed -e "s/30ms/${c} 30ms/" | \
  67. sort -k4 -n && \
  68. echo "Stopping Duoram dockers" && \
  69. echo && ./stop-docker ) | tee -a $outputfile
  70. if [ ${PIPESTATUS[0]} != "0" ]; then
  71. exit 1
  72. fi
  73. # Floram
  74. echo
  75. echo Running Floram repro
  76. echo
  77. ( cd floram-docker && echo "Starting Floram dockers" && echo && \
  78. ./start-docker && $repro_scaling $numops && \
  79. cat read_30ms_100mbit_${numops}.out.${c}core | \
  80. docker exec -w /root -i floram_p0 ./parse_logs | \
  81. egrep ' read .*s$' | sed -e "s/30ms/${c} 30ms/" | \
  82. sort -k4 -n && \
  83. echo "Stopping Floram dockers" && \
  84. echo && ./stop-docker ) | tee -a $outputfile
  85. if [ ${PIPESTATUS[0]} != "0" ]; then
  86. exit 1
  87. fi
  88. done
  89. echo
  90. echo "# Figure 10(a)"
  91. grep 'Floram read 16 ' $outputfile
  92. echo
  93. grep '2PDuoramOnln read 16 ' $outputfile
  94. echo
  95. grep '3PDuoramOnln read 16 ' $outputfile
  96. echo
  97. echo "# Figure 10(b)"
  98. grep 'Floram read 20 ' $outputfile
  99. echo
  100. grep '2PDuoramOnln read 20 ' $outputfile
  101. echo
  102. grep '3PDuoramOnln read 20 ' $outputfile
  103. echo
  104. echo "# Figure 10(c)"
  105. grep 'Floram read 26 ' $outputfile
  106. echo
  107. grep '2PDuoramOnln read 26 ' $outputfile
  108. echo
  109. grep '3PDuoramOnln read 26 ' $outputfile
  110. echo