run-experiment 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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=oram_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. 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" &
  30. sleep 2
  31. 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" &
  32. wait
  33. echo ===== P0 output
  34. docker exec -w /root/floram-floram-release/build/tests floram_p0 cat $savefilep0
  35. docker exec -w /root/floram-floram-release/build/tests floram_p0 rm -f $savefilep0
  36. echo ===== P1 output
  37. docker exec -w /root/floram-floram-release/build/tests floram_p1 cat $savefilep1
  38. docker exec -w /root/floram-floram-release/build/tests floram_p1 rm -f $savefilep1
  39. date "+===== End %s %F %T"