run-experiment 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. # Get the IP addresses
  3. p0addr=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' floram_p0)
  4. p1addr=$(docker inspect --format='{{ .NetworkSettings.IPAddress }}' floram_p1)
  5. # The Floram mode and size
  6. # mode is read, write, readwrite, or init
  7. mode=read
  8. size=20
  9. iters=128
  10. port=3000
  11. if [ "$1" != "" ]; then
  12. mode="$1"
  13. fi
  14. if [ "$2" != "" ]; then
  15. size="$2"
  16. fi
  17. if [ "$3" != "" ]; then
  18. iters="$3"
  19. fi
  20. if [ "$4" != "" ]; then
  21. port="$4"
  22. fi
  23. items=$((1<<size))
  24. echo ===== Running floram $mode $size $iters
  25. date "+===== Start %s %F %T"
  26. # Run, saving the output
  27. savefilep0=$$.p0.out
  28. savefilep1=$$.p1.out
  29. if [ "$mode" = "bs" ]; then
  30. docker exec -w /root/floram-floram-release/build/tests floram_p0 bash -c "$FLORAM_NUMA_P0 stdbuf -o 0 ./bench_$mode -p $port -s $iters -o fssl_cprg -e $items -i 1 > $savefilep0 2>&1" &
  31. else
  32. docker exec -w /root/floram-floram-release/build/tests floram_p0 bash -c "$FLORAM_NUMA_P0 stdbuf -o 0 ./bench_oram_$mode -p $port -s 8 -o fssl_cprg -e $items -i $iters > $savefilep0 2>&1" &
  33. fi
  34. sleep 2
  35. if [ "$mode" = "bs" ]; then
  36. docker exec -w /root/floram-floram-release/build/tests floram_p1 bash -c "$FLORAM_NUMA_P1 stdbuf -o 0 ./bench_$mode -c $p0addr -p $port -s $iters -o fssl_cprg -e $items -i 1 > $savefilep1 2>&1" &
  37. else
  38. docker exec -w /root/floram-floram-release/build/tests floram_p1 bash -c "$FLORAM_NUMA_P1 stdbuf -o 0 ./bench_oram_$mode -c $p0addr -p $port -s 8 -o fssl_cprg -e $items -i $iters > $savefilep1 2>&1"
  39. fi
  40. wait
  41. echo ===== P0 output
  42. docker exec -w /root/floram-floram-release/build/tests floram_p0 cat $savefilep0
  43. docker exec -w /root/floram-floram-release/build/tests floram_p0 rm -f $savefilep0
  44. echo ===== P1 output
  45. docker exec -w /root/floram-floram-release/build/tests floram_p1 cat $savefilep1
  46. docker exec -w /root/floram-floram-release/build/tests floram_p1 rm -f $savefilep1
  47. date "+===== End %s %F %T"