repro-scaling 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. # The number of operations to do
  30. numops=128
  31. if [ "$1" != "" ]; then
  32. numops="$1"
  33. fi
  34. outputfile=$$.scaling.log
  35. cleanup() {
  36. rm -f $outputfile
  37. exit
  38. }
  39. trap cleanup EXIT SIGINT
  40. # Stop any running dockers
  41. ./stop-all-dockers
  42. for c in $CORESLIST; do
  43. echo
  44. echo "Using $c cores..."
  45. echo
  46. export DUORAM_NUMA_P0="$BASE_DUORAM_NUMA_P0 numactl -C +0-$((c-1))"
  47. export DUORAM_NUMA_P1="$BASE_DUORAM_NUMA_P1 numactl -C +0-$((c-1))"
  48. export DUORAM_NUMA_P2="$BASE_DUORAM_NUMA_P0 numactl -C +0-$((c-1))"
  49. export LOGSUFFIX=".${c}core"
  50. # Duoram
  51. echo
  52. echo Running Duoram repro
  53. echo
  54. ( cd ../Docker && echo "Starting Duoram dockers" && echo && \
  55. ./start-docker && ./repro scaling $numops && \
  56. cat read_30ms_100mbit_${numops}_*.out.${c}core | \
  57. docker exec -w /root/duoram/Docker -i duoram_p0 ./parse_logs | \
  58. egrep 'DuoramOnln read .*s$' | sed -e "s/30ms/${c} 30ms/" | \
  59. sort -k4 -n && \
  60. echo "Stopping Duoram dockers" && \
  61. echo && ./stop-docker ) | tee -a $outputfile
  62. if [ ${PIPESTATUS[0]} != "0" ]; then
  63. exit 1
  64. fi
  65. # Floram
  66. echo
  67. echo Running Floram repro
  68. echo
  69. ( cd floram-docker && echo "Starting Floram dockers" && echo && \
  70. ./start-docker && ./repro scaling $numops && \
  71. cat read_30ms_100mbit_${numops}.out.${c}core | \
  72. docker exec -w /root -i floram_p0 ./parse_logs | \
  73. egrep ' read .*s$' | sed -e "s/30ms/${c} 30ms/" | \
  74. sort -k4 -n && \
  75. echo "Stopping Floram dockers" && \
  76. echo && ./stop-docker ) | tee -a $outputfile
  77. if [ ${PIPESTATUS[0]} != "0" ]; then
  78. exit 1
  79. fi
  80. done
  81. echo
  82. echo "# Figure 10(a)"
  83. grep 'Floram read 16 ' $outputfile
  84. echo
  85. grep '2PDuoramOnln read 16 ' $outputfile
  86. echo
  87. grep '3PDuoramOnln read 16 ' $outputfile
  88. echo
  89. echo "# Figure 10(b)"
  90. grep 'Floram read 20 ' $outputfile
  91. echo
  92. grep '2PDuoramOnln read 20 ' $outputfile
  93. echo
  94. grep '3PDuoramOnln read 20 ' $outputfile
  95. echo
  96. echo "# Figure 10(c)"
  97. grep 'Floram read 26 ' $outputfile
  98. echo
  99. grep '2PDuoramOnln read 26 ' $outputfile
  100. echo
  101. grep '3PDuoramOnln read 26 ' $outputfile
  102. echo