diff --git a/runtime/experiments/applications/ekf/by_iteration/.gitignore b/runtime/experiments/applications/ekf/by_iteration/.gitignore new file mode 100644 index 0000000..343f11e --- /dev/null +++ b/runtime/experiments/applications/ekf/by_iteration/.gitignore @@ -0,0 +1,3 @@ +*res.dat +rt.log +log.csv diff --git a/runtime/experiments/applications/ekf/by_iteration/README.md b/runtime/experiments/applications/ekf/by_iteration/README.md new file mode 100644 index 0000000..3dd556d --- /dev/null +++ b/runtime/experiments/applications/ekf/by_iteration/README.md @@ -0,0 +1,11 @@ +# EKF + +Executes TinyEKF as shows by [You Chong's GPS example](http://www.mathworks.com/matlabcentral/fileexchange/31487-extended-kalman-filter-ekf--for-gps) + +This test executes multiple runs of three iterations (the output of a previous iteration is refed as input), comparing the binary result against a known memoized result stored in `initial_state.dat`, `one_iteration.dat`, `two_iterations.dat`, and `three_iterations.dat`. + +The `rust.sh` script stores per-run results to temporary files suffixed with `*.res.dat` and `diff -s` because I had trouble using cURL to pass a bash string of binary input. + +In order to be compatible with the stdin/stdout model of serverless, the input and output files are binary concatenations of various C structs. + +See `main()` in `runtime/tests/TinyEKF/extras/c/gps_ekf_fn.c` for specifics. diff --git a/runtime/experiments/applications/by_dpi/debug.sh b/runtime/experiments/applications/ekf/by_iteration/debug.sh similarity index 94% rename from runtime/experiments/applications/by_dpi/debug.sh rename to runtime/experiments/applications/ekf/by_iteration/debug.sh index a561392..6ab3666 100755 --- a/runtime/experiments/applications/by_dpi/debug.sh +++ b/runtime/experiments/applications/ekf/by_iteration/debug.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" diff --git a/runtime/experiments/applications/ekf/ekf_raw.dat b/runtime/experiments/applications/ekf/by_iteration/initial_state.dat similarity index 100% rename from runtime/experiments/applications/ekf/ekf_raw.dat rename to runtime/experiments/applications/ekf/by_iteration/initial_state.dat diff --git a/runtime/experiments/applications/ekf/expected_result.dat b/runtime/experiments/applications/ekf/by_iteration/one_iteration.dat similarity index 100% rename from runtime/experiments/applications/ekf/expected_result.dat rename to runtime/experiments/applications/ekf/by_iteration/one_iteration.dat diff --git a/runtime/experiments/applications/ekf/by_iteration/run.sh b/runtime/experiments/applications/ekf/by_iteration/run.sh new file mode 100755 index 0000000..870dca1 --- /dev/null +++ b/runtime/experiments/applications/ekf/by_iteration/run.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +runtime_directory=$(cd ../../../.. && pwd) +binary_directory=$(cd "$runtime_directory"/bin && pwd) +log="$experiment_directory/log.csv" + +# Copy data if not here +if [[ ! -f "./initial_state.dat" ]]; then + cp $runtime_directory/tests/TinyEKF/extras/c/ekf_raw.dat ./initial_state.dat +fi + +if [ "$1" != "-d" ]; then + SLEDGE_SANDBOX_PERF_LOG=$log PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" >rt.log 2>&1 & + sleep 2 +else + echo "Running under gdb" +fi + +one_iteration_expected_result="$(tr -d '\0' <./one_iteration.dat)" +two_iterations_expected_result="$(tr -d '\0' <./two_iterations.dat)" +three_iterations_expected_result="$(tr -d '\0' <./three_iterations.dat)" + +success_count=0 +total_count=50 + +for ((i = 0; i < total_count; i++)); do + echo "$i" + curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@initial_state.dat" localhost:10000 2>/dev/null >./one_iteration_res.dat + curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@one_iteration_res.dat" localhost:10001 2>/dev/null >./two_iterations_res.dat + curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@two_iterations_res.dat" localhost:10002 2>/dev/null >./three_iterations_res.dat + if diff -s one_iteration_res.dat one_iteration.dat && diff -s two_iterations_res.dat two_iterations.dat && diff -s three_iterations_res.dat three_iterations.dat; then + success_count=$((success_count + 1)) + else + echo "FAIL" + exit + fi + + rm *_res.dat +done + +echo "$success_count / $total_count" + +if [ "$1" != "-d" ]; then + sleep 5 + echo -n "Running Cleanup: " + pkill sledgert >/dev/null 2>/dev/null + echo "[DONE]" +fi diff --git a/runtime/experiments/applications/ekf/by_iteration/spec.json b/runtime/experiments/applications/ekf/by_iteration/spec.json new file mode 100644 index 0000000..2043944 --- /dev/null +++ b/runtime/experiments/applications/ekf/by_iteration/spec.json @@ -0,0 +1,42 @@ +{ + "active": "yes", + "name": "ekf_first_iter", + "path": "ekf_wasm.so", + "port": 10000, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "application/octet-stream", + "http-req-size": 1024000, + "http-resp-headers": [], + "http-resp-size": 1024000, + "http-resp-content-type": "application/octet-stream" +}, +{ + "active": "yes", + "name": "ekf_second_iter", + "path": "ekf_wasm.so", + "port": 10001, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "application/octet-stream", + "http-req-size": 1024000, + "http-resp-headers": [], + "http-resp-size": 1024000, + "http-resp-content-type": "application/octet-stream" +}, +{ + "active": "yes", + "name": "ekf_third_iter", + "path": "ekf_wasm.so", + "port": 10002, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "application/octet-stream", + "http-req-size": 1024000, + "http-resp-headers": [], + "http-resp-size": 1024000, + "http-resp-content-type": "application/octet-stream" +} diff --git a/runtime/experiments/applications/ekf/by_iteration/three_iterations.dat b/runtime/experiments/applications/ekf/by_iteration/three_iterations.dat new file mode 100644 index 0000000..cc0ab73 Binary files /dev/null and b/runtime/experiments/applications/ekf/by_iteration/three_iterations.dat differ diff --git a/runtime/experiments/applications/ekf/by_iteration/two_iterations.dat b/runtime/experiments/applications/ekf/by_iteration/two_iterations.dat new file mode 100644 index 0000000..a98da81 Binary files /dev/null and b/runtime/experiments/applications/ekf/by_iteration/two_iterations.dat differ diff --git a/runtime/experiments/applications/ekf/.gitignore b/runtime/experiments/applications/ekf/one_iteration/.gitignore similarity index 100% rename from runtime/experiments/applications/ekf/.gitignore rename to runtime/experiments/applications/ekf/one_iteration/.gitignore diff --git a/runtime/experiments/applications/ekf/README.md b/runtime/experiments/applications/ekf/one_iteration/README.md similarity index 100% rename from runtime/experiments/applications/ekf/README.md rename to runtime/experiments/applications/ekf/one_iteration/README.md diff --git a/runtime/experiments/applications/by_word/debug.sh b/runtime/experiments/applications/ekf/one_iteration/debug.sh similarity index 94% rename from runtime/experiments/applications/by_word/debug.sh rename to runtime/experiments/applications/ekf/one_iteration/debug.sh index a561392..6ab3666 100755 --- a/runtime/experiments/applications/by_word/debug.sh +++ b/runtime/experiments/applications/ekf/one_iteration/debug.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" diff --git a/runtime/experiments/applications/ekf/one_iteration/ekf_raw.dat b/runtime/experiments/applications/ekf/one_iteration/ekf_raw.dat new file mode 100644 index 0000000..9a960e1 Binary files /dev/null and b/runtime/experiments/applications/ekf/one_iteration/ekf_raw.dat differ diff --git a/runtime/experiments/applications/ekf/one_iteration/expected_result.dat b/runtime/experiments/applications/ekf/one_iteration/expected_result.dat new file mode 100644 index 0000000..1229f11 Binary files /dev/null and b/runtime/experiments/applications/ekf/one_iteration/expected_result.dat differ diff --git a/runtime/experiments/applications/ekf/run.sh b/runtime/experiments/applications/ekf/one_iteration/run.sh similarity index 96% rename from runtime/experiments/applications/ekf/run.sh rename to runtime/experiments/applications/ekf/one_iteration/run.sh index dde0d66..0eb5dae 100755 --- a/runtime/experiments/applications/ekf/run.sh +++ b/runtime/experiments/applications/ekf/one_iteration/run.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) # Copy data if not here diff --git a/runtime/experiments/applications/ekf/spec.json b/runtime/experiments/applications/ekf/one_iteration/spec.json similarity index 100% rename from runtime/experiments/applications/ekf/spec.json rename to runtime/experiments/applications/ekf/one_iteration/spec.json diff --git a/runtime/experiments/applications/fivebyeight/debug.sh b/runtime/experiments/applications/fivebyeight/debug.sh deleted file mode 100755 index a561392..0000000 --- a/runtime/experiments/applications/fivebyeight/debug.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Executes the runtime in GDB -# Substitutes the absolute path from the container with a path relatively derived from the location of this script -# This allows debugging outside of the Docker container -# Also disables pagination and stopping on SIGUSR1 - -experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) -binary_directory=$(cd "$project_directory"/bin && pwd) - -export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" -export PATH="$binary_directory:$PATH" - -gdb --eval-command="handle SIGUSR1 nostop" \ - --eval-command="handle SIGPIPE nostop" \ - --eval-command="set pagination off" \ - --eval-command="set substitute-path /sledge/runtime $project_directory" \ - --eval-command="run $experiment_directory/spec.json" \ - sledgert diff --git a/runtime/experiments/applications/handwriting/debug.sh b/runtime/experiments/applications/handwriting/debug.sh deleted file mode 100755 index a561392..0000000 --- a/runtime/experiments/applications/handwriting/debug.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Executes the runtime in GDB -# Substitutes the absolute path from the container with a path relatively derived from the location of this script -# This allows debugging outside of the Docker container -# Also disables pagination and stopping on SIGUSR1 - -experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) -binary_directory=$(cd "$project_directory"/bin && pwd) - -export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" -export PATH="$binary_directory:$PATH" - -gdb --eval-command="handle SIGUSR1 nostop" \ - --eval-command="handle SIGPIPE nostop" \ - --eval-command="set pagination off" \ - --eval-command="set substitute-path /sledge/runtime $project_directory" \ - --eval-command="run $experiment_directory/spec.json" \ - sledgert diff --git a/runtime/experiments/applications/hyde/debug.sh b/runtime/experiments/applications/hyde/debug.sh deleted file mode 100755 index a561392..0000000 --- a/runtime/experiments/applications/hyde/debug.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Executes the runtime in GDB -# Substitutes the absolute path from the container with a path relatively derived from the location of this script -# This allows debugging outside of the Docker container -# Also disables pagination and stopping on SIGUSR1 - -experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) -binary_directory=$(cd "$project_directory"/bin && pwd) - -export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" -export PATH="$binary_directory:$PATH" - -gdb --eval-command="handle SIGUSR1 nostop" \ - --eval-command="handle SIGPIPE nostop" \ - --eval-command="set pagination off" \ - --eval-command="set substitute-path /sledge/runtime $project_directory" \ - --eval-command="run $experiment_directory/spec.json" \ - sledgert diff --git a/runtime/experiments/applications/by_dpi/.gitignore b/runtime/experiments/applications/ocr/by_dpi/.gitignore similarity index 100% rename from runtime/experiments/applications/by_dpi/.gitignore rename to runtime/experiments/applications/ocr/by_dpi/.gitignore diff --git a/runtime/experiments/applications/by_dpi/README.md b/runtime/experiments/applications/ocr/by_dpi/README.md similarity index 100% rename from runtime/experiments/applications/by_dpi/README.md rename to runtime/experiments/applications/ocr/by_dpi/README.md diff --git a/runtime/experiments/applications/by_font/debug.sh b/runtime/experiments/applications/ocr/by_dpi/debug.sh similarity index 94% rename from runtime/experiments/applications/by_font/debug.sh rename to runtime/experiments/applications/ocr/by_dpi/debug.sh index a561392..6ab3666 100755 --- a/runtime/experiments/applications/by_font/debug.sh +++ b/runtime/experiments/applications/ocr/by_dpi/debug.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" diff --git a/runtime/experiments/applications/by_dpi/install.sh b/runtime/experiments/applications/ocr/by_dpi/install.sh similarity index 100% rename from runtime/experiments/applications/by_dpi/install.sh rename to runtime/experiments/applications/ocr/by_dpi/install.sh diff --git a/runtime/experiments/applications/by_dpi/run.sh b/runtime/experiments/applications/ocr/by_dpi/run.sh similarity index 97% rename from runtime/experiments/applications/by_dpi/run.sh rename to runtime/experiments/applications/ocr/by_dpi/run.sh index c5f49ce..938a43b 100755 --- a/runtime/experiments/applications/by_dpi/run.sh +++ b/runtime/experiments/applications/ocr/by_dpi/run.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) log="$experiment_directory/log.csv" diff --git a/runtime/experiments/applications/by_dpi/spec.json b/runtime/experiments/applications/ocr/by_dpi/spec.json similarity index 100% rename from runtime/experiments/applications/by_dpi/spec.json rename to runtime/experiments/applications/ocr/by_dpi/spec.json diff --git a/runtime/experiments/applications/by_font/.gitignore b/runtime/experiments/applications/ocr/by_font/.gitignore similarity index 100% rename from runtime/experiments/applications/by_font/.gitignore rename to runtime/experiments/applications/ocr/by_font/.gitignore diff --git a/runtime/experiments/applications/by_font/README.md b/runtime/experiments/applications/ocr/by_font/README.md similarity index 100% rename from runtime/experiments/applications/by_font/README.md rename to runtime/experiments/applications/ocr/by_font/README.md diff --git a/runtime/experiments/applications/ekf/debug.sh b/runtime/experiments/applications/ocr/by_font/debug.sh similarity index 94% rename from runtime/experiments/applications/ekf/debug.sh rename to runtime/experiments/applications/ocr/by_font/debug.sh index a561392..6ab3666 100755 --- a/runtime/experiments/applications/ekf/debug.sh +++ b/runtime/experiments/applications/ocr/by_font/debug.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" diff --git a/runtime/experiments/applications/by_font/install.sh b/runtime/experiments/applications/ocr/by_font/install.sh similarity index 100% rename from runtime/experiments/applications/by_font/install.sh rename to runtime/experiments/applications/ocr/by_font/install.sh diff --git a/runtime/experiments/applications/by_font/run.sh b/runtime/experiments/applications/ocr/by_font/run.sh similarity index 98% rename from runtime/experiments/applications/by_font/run.sh rename to runtime/experiments/applications/ocr/by_font/run.sh index 86234ed..cb526a9 100755 --- a/runtime/experiments/applications/by_font/run.sh +++ b/runtime/experiments/applications/ocr/by_font/run.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) log="$experiment_directory/log.csv" diff --git a/runtime/experiments/applications/by_font/spec.json b/runtime/experiments/applications/ocr/by_font/spec.json similarity index 100% rename from runtime/experiments/applications/by_font/spec.json rename to runtime/experiments/applications/ocr/by_font/spec.json diff --git a/runtime/experiments/applications/by_word/.gitignore b/runtime/experiments/applications/ocr/by_word/.gitignore similarity index 100% rename from runtime/experiments/applications/by_word/.gitignore rename to runtime/experiments/applications/ocr/by_word/.gitignore diff --git a/runtime/experiments/applications/by_word/README.md b/runtime/experiments/applications/ocr/by_word/README.md similarity index 100% rename from runtime/experiments/applications/by_word/README.md rename to runtime/experiments/applications/ocr/by_word/README.md diff --git a/runtime/experiments/applications/ocr/by_word/debug.sh b/runtime/experiments/applications/ocr/by_word/debug.sh new file mode 100755 index 0000000..6ab3666 --- /dev/null +++ b/runtime/experiments/applications/ocr/by_word/debug.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" +export PATH="$binary_directory:$PATH" + +gdb --eval-command="handle SIGUSR1 nostop" \ + --eval-command="handle SIGPIPE nostop" \ + --eval-command="set pagination off" \ + --eval-command="set substitute-path /sledge/runtime $project_directory" \ + --eval-command="run $experiment_directory/spec.json" \ + sledgert diff --git a/runtime/experiments/applications/by_word/install.sh b/runtime/experiments/applications/ocr/by_word/install.sh similarity index 100% rename from runtime/experiments/applications/by_word/install.sh rename to runtime/experiments/applications/ocr/by_word/install.sh diff --git a/runtime/experiments/applications/by_word/run.sh b/runtime/experiments/applications/ocr/by_word/run.sh similarity index 97% rename from runtime/experiments/applications/by_word/run.sh rename to runtime/experiments/applications/ocr/by_word/run.sh index e4a4354..f1f098a 100755 --- a/runtime/experiments/applications/by_word/run.sh +++ b/runtime/experiments/applications/ocr/by_word/run.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) log="$experiment_directory/log.csv" diff --git a/runtime/experiments/applications/by_word/spec.json b/runtime/experiments/applications/ocr/by_word/spec.json similarity index 100% rename from runtime/experiments/applications/by_word/spec.json rename to runtime/experiments/applications/ocr/by_word/spec.json diff --git a/runtime/experiments/applications/fivebyeight/5x8.png b/runtime/experiments/applications/ocr/fivebyeight/5x8.png similarity index 100% rename from runtime/experiments/applications/fivebyeight/5x8.png rename to runtime/experiments/applications/ocr/fivebyeight/5x8.png diff --git a/runtime/experiments/applications/fivebyeight/5x8.pnm b/runtime/experiments/applications/ocr/fivebyeight/5x8.pnm similarity index 100% rename from runtime/experiments/applications/fivebyeight/5x8.pnm rename to runtime/experiments/applications/ocr/fivebyeight/5x8.pnm diff --git a/runtime/experiments/applications/fivebyeight/README.md b/runtime/experiments/applications/ocr/fivebyeight/README.md similarity index 100% rename from runtime/experiments/applications/fivebyeight/README.md rename to runtime/experiments/applications/ocr/fivebyeight/README.md diff --git a/runtime/experiments/applications/ocr/fivebyeight/debug.sh b/runtime/experiments/applications/ocr/fivebyeight/debug.sh new file mode 100755 index 0000000..6ab3666 --- /dev/null +++ b/runtime/experiments/applications/ocr/fivebyeight/debug.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" +export PATH="$binary_directory:$PATH" + +gdb --eval-command="handle SIGUSR1 nostop" \ + --eval-command="handle SIGPIPE nostop" \ + --eval-command="set pagination off" \ + --eval-command="set substitute-path /sledge/runtime $project_directory" \ + --eval-command="run $experiment_directory/spec.json" \ + sledgert diff --git a/runtime/experiments/applications/fivebyeight/expected_result.txt b/runtime/experiments/applications/ocr/fivebyeight/expected_result.txt similarity index 100% rename from runtime/experiments/applications/fivebyeight/expected_result.txt rename to runtime/experiments/applications/ocr/fivebyeight/expected_result.txt diff --git a/runtime/experiments/applications/fivebyeight/run.sh b/runtime/experiments/applications/ocr/fivebyeight/run.sh similarity index 96% rename from runtime/experiments/applications/fivebyeight/run.sh rename to runtime/experiments/applications/ocr/fivebyeight/run.sh index 3271539..812308d 100755 --- a/runtime/experiments/applications/fivebyeight/run.sh +++ b/runtime/experiments/applications/ocr/fivebyeight/run.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) if [ "$1" != "-d" ]; then diff --git a/runtime/experiments/applications/fivebyeight/spec.json b/runtime/experiments/applications/ocr/fivebyeight/spec.json similarity index 100% rename from runtime/experiments/applications/fivebyeight/spec.json rename to runtime/experiments/applications/ocr/fivebyeight/spec.json diff --git a/runtime/experiments/applications/ocr/handwriting/debug.sh b/runtime/experiments/applications/ocr/handwriting/debug.sh new file mode 100755 index 0000000..6ab3666 --- /dev/null +++ b/runtime/experiments/applications/ocr/handwriting/debug.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" +export PATH="$binary_directory:$PATH" + +gdb --eval-command="handle SIGUSR1 nostop" \ + --eval-command="handle SIGPIPE nostop" \ + --eval-command="set pagination off" \ + --eval-command="set substitute-path /sledge/runtime $project_directory" \ + --eval-command="run $experiment_directory/spec.json" \ + sledgert diff --git a/runtime/experiments/applications/handwriting/expected_result.txt b/runtime/experiments/applications/ocr/handwriting/expected_result.txt similarity index 100% rename from runtime/experiments/applications/handwriting/expected_result.txt rename to runtime/experiments/applications/ocr/handwriting/expected_result.txt diff --git a/runtime/experiments/applications/handwriting/handwrt1.jpg b/runtime/experiments/applications/ocr/handwriting/handwrt1.jpg similarity index 100% rename from runtime/experiments/applications/handwriting/handwrt1.jpg rename to runtime/experiments/applications/ocr/handwriting/handwrt1.jpg diff --git a/runtime/experiments/applications/handwriting/handwrt1.pnm b/runtime/experiments/applications/ocr/handwriting/handwrt1.pnm similarity index 100% rename from runtime/experiments/applications/handwriting/handwrt1.pnm rename to runtime/experiments/applications/ocr/handwriting/handwrt1.pnm diff --git a/runtime/experiments/applications/handwriting/run.sh b/runtime/experiments/applications/ocr/handwriting/run.sh similarity index 96% rename from runtime/experiments/applications/handwriting/run.sh rename to runtime/experiments/applications/ocr/handwriting/run.sh index f6d2287..ed4ec16 100755 --- a/runtime/experiments/applications/handwriting/run.sh +++ b/runtime/experiments/applications/ocr/handwriting/run.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) if [ "$1" != "-d" ]; then diff --git a/runtime/experiments/applications/handwriting/spec.json b/runtime/experiments/applications/ocr/handwriting/spec.json similarity index 100% rename from runtime/experiments/applications/handwriting/spec.json rename to runtime/experiments/applications/ocr/handwriting/spec.json diff --git a/runtime/experiments/applications/hyde/README.md b/runtime/experiments/applications/ocr/hyde/README.md similarity index 100% rename from runtime/experiments/applications/hyde/README.md rename to runtime/experiments/applications/ocr/hyde/README.md diff --git a/runtime/experiments/applications/ocr/hyde/debug.sh b/runtime/experiments/applications/ocr/hyde/debug.sh new file mode 100755 index 0000000..6ab3666 --- /dev/null +++ b/runtime/experiments/applications/ocr/hyde/debug.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" +export PATH="$binary_directory:$PATH" + +gdb --eval-command="handle SIGUSR1 nostop" \ + --eval-command="handle SIGPIPE nostop" \ + --eval-command="set pagination off" \ + --eval-command="set substitute-path /sledge/runtime $project_directory" \ + --eval-command="run $experiment_directory/spec.json" \ + sledgert diff --git a/runtime/experiments/applications/hyde/expected_result.txt b/runtime/experiments/applications/ocr/hyde/expected_result.txt similarity index 100% rename from runtime/experiments/applications/hyde/expected_result.txt rename to runtime/experiments/applications/ocr/hyde/expected_result.txt diff --git a/runtime/experiments/applications/hyde/hyde.jpg b/runtime/experiments/applications/ocr/hyde/hyde.jpg similarity index 100% rename from runtime/experiments/applications/hyde/hyde.jpg rename to runtime/experiments/applications/ocr/hyde/hyde.jpg diff --git a/runtime/experiments/applications/hyde/hyde.pnm b/runtime/experiments/applications/ocr/hyde/hyde.pnm similarity index 100% rename from runtime/experiments/applications/hyde/hyde.pnm rename to runtime/experiments/applications/ocr/hyde/hyde.pnm diff --git a/runtime/experiments/applications/hyde/run.sh b/runtime/experiments/applications/ocr/hyde/run.sh similarity index 96% rename from runtime/experiments/applications/hyde/run.sh rename to runtime/experiments/applications/ocr/hyde/run.sh index 32a6d6d..2d46d22 100755 --- a/runtime/experiments/applications/hyde/run.sh +++ b/runtime/experiments/applications/ocr/hyde/run.sh @@ -5,7 +5,7 @@ # Also disables pagination and stopping on SIGUSR1 experiment_directory=$(pwd) -project_directory=$(cd ../../.. && pwd) +project_directory=$(cd ../../../.. && pwd) binary_directory=$(cd "$project_directory"/bin && pwd) if [ "$1" != "-d" ]; then diff --git a/runtime/experiments/applications/hyde/spec.json b/runtime/experiments/applications/ocr/hyde/spec.json similarity index 100% rename from runtime/experiments/applications/hyde/spec.json rename to runtime/experiments/applications/ocr/hyde/spec.json