refactor: assorted bash cleanup

main
Sean McBride 4 years ago
parent 6043fb5536
commit 6dc172952c

@ -1,3 +1,2 @@
LD_LIBRARY_PATH=/sledge/runtime/bin
SLEDGE_NWORKERS=1
SLEDGE_SCHEDULER=EDF

@ -3,12 +3,12 @@
# If already installed, just return
command -v perf && {
echo "perf is already installed."
exit 0
return 0
}
[[ "$(whoami)" != "root" ]] && {
echo "Expected to run as root"
exit 1
return 1
}
# Under WSL2, perf has to be installed from source
@ -22,5 +22,3 @@ if grep --silent 'WSL2' <(uname -r); then
else
apt-get install "linux-tools-$(uname -r)" linux-tools-generic -y
fi
exit 0

@ -8,20 +8,10 @@ export PATH="$__run_sh__bash_libraries_absolute_path:$PATH"
source csv_to_dat.sh || exit 1
source framework.sh || exit 1
# source generate_gnuplots.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Copy data if not here
if [[ ! -f "$__run_sh__base_path/initial_state.dat" ]]; then
pushd "$__run_sh__base_path" || exit 1
pushd "../../../../tests/TinyEKF/extras/c/" || exit 1
cp ekf_raw.dat "$__run_sh__base_path/initial_state.dat" || exit 1
popd || exit 1
popd || exit 1
fi
run_functional_tests() {
local hostname="$1"
local results_directory="$2"
@ -29,38 +19,37 @@ run_functional_tests() {
local -i success_count=0
local -ir total_count=50
echo -n "Functional Tests: "
local tmpfs_dir=/tmp/sledge_ekf_by_iteration
[[ -d "$tmpfs_dir" ]] && {
echo "$tmpfs_dir directory exists. Delete via rm -r $tmpfs_dir and rerun."
return 1
}
mkdir "$tmpfs_dir" || {
echo "Failed to create tmp directory"
return 1
}
for ((i = 0; i < total_count; i++)); do
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@initial_state.dat" "$hostname":10000 2> /dev/null > /tmp/one_iteration_res.dat
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@/tmp/one_iteration_res.dat" "$hostname":10001 2> /dev/null > /tmp/two_iterations_res.dat
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@/tmp/two_iterations_res.dat" "$hostname":10002 2> /dev/null > /tmp/three_iterations_res.dat
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@initial_state.dat" "$hostname":10000 2> /dev/null > "$tmpfs_dir/one_iteration_res.dat"
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@$tmpfs_dir/one_iteration_res.dat" "$hostname":10001 2> /dev/null > "$tmpfs_dir/two_iterations_res.dat"
curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@$tmpfs_dir/two_iterations_res.dat" "$hostname":10002 2> /dev/null > "$tmpfs_dir/three_iterations_res.dat"
if diff -s /tmp/one_iteration_res.dat one_iteration.dat > /dev/null && diff -s /tmp/two_iterations_res.dat two_iterations.dat > /dev/null && diff -s /tmp/three_iterations_res.dat three_iterations.dat > /dev/null; then
if diff -s "$tmpfs_dir/one_iteration_res.dat" one_iteration.dat > /dev/null \
&& diff -s "$tmpfs_dir/two_iterations_res.dat" two_iterations.dat > /dev/null \
&& diff -s "$tmpfs_dir/three_iterations_res.dat" three_iterations.dat > /dev/null; then
((success_count++))
fi
rm /tmp/*_res.dat
done
echo "$success_count / $total_count" >> "$results_directory/results.txt"
rm -r "$tmpfs_dir"
if ((success_count == total_count)); then
echo "[OK]"
return 0
else
echo "[Fail]"
return 1
fi
}
declare -a workloads=(initial_state one_iteration two_iterations)
declare -A port=(
[initial_state]=10000
[one_iteration]=10001
[two_iterations]=10002
)
run_perf_tests() {
local hostname="$1"
local results_directory="$2"
@ -69,6 +58,7 @@ run_perf_tests() {
local -ir worker_max=10
local -ir batch_size=10
local -i batch_id=0
local pids
echo -n "Perf Tests: "
for workload in "${workloads[@]}"; do
@ -82,7 +72,8 @@ run_perf_tests() {
hey -disable-compression -disable-keepalive -disable-redirects -n $batch_size -c 1 -cpus 1 -t 0 -o csv -m GET -D "./${workload}.dat" "http://${hostname}:${port[$workload]}" > "$results_directory/${workload}_${batch_id}.csv" &
done
wait -f $(pgrep hey | tr '\n' ' ')
pids=$(pgrep hey | tr '\n' ' ')
[[ -n $pids ]] && wait -f $pids
done
echo "[OK]"
@ -153,6 +144,23 @@ experiment_main() {
run_perf_tests "$hostname" "$results_directory" || return 1
process_results "$results_directory" || return 1
return 0
}
# Copy data if not here
if [[ ! -f "$__run_sh__base_path/initial_state.dat" ]]; then
pushd "$__run_sh__base_path" || exit 1
pushd "../../../../tests/TinyEKF/extras/c/" || exit 1
cp ekf_raw.dat "$__run_sh__base_path/initial_state.dat" || exit 1
popd || exit 1
popd || exit 1
fi
declare -a workloads=(initial_state one_iteration two_iterations)
declare -A port=(
[initial_state]=10000
[one_iteration]=10001
[two_iterations]=10002
)
main "$@"

@ -12,15 +12,6 @@ source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Copy data if not here
if [[ ! -f "$__run_sh__base_path/initial_state.dat" ]]; then
pushd "$__run_sh__base_path" || exit 1
pushd "../../../../tests/TinyEKF/extras/c/" || exit 1
cp ekf_raw.dat "$__run_sh__base_path/initial_state.dat" || exit 1
popd || exit 1
popd || exit 1
fi
run_functional_tests() {
local -r hostname="$1"
local -r results_directory="$2"
@ -31,23 +22,23 @@ run_functional_tests() {
expected_result="$(tr -d '\0' < ./expected_result.dat)"
for ((i = 0; i < total_count; i++)); do
result="$(curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@ekf_raw.dat" localhost:10000 2> /dev/null | tr -d '\0')"
result="$(curl -H 'Expect:' -H "Content-Type: application/octet-stream" --data-binary "@ekf_raw.dat" "$hostname:10000" 2> /dev/null | tr -d '\0')"
if [[ "$expected_result" == "$result" ]]; then
((success_count++))
else
echo "Failed on $i:"
echo "$result"
{
echo "Failed on $i:"
echo "$result"
} | tee -a "$results_directory/result.txt"
break
fi
done
echo "$success_count / $total_count"
echo "$success_count / $total_count" | tee -a "$results_directory/result.txt"
if ((success_count == total_count)); then
echo "[OK]"
return 0
else
echo "[Fail]"
return 1
fi
}
@ -59,4 +50,13 @@ experiment_main() {
run_functional_tests "$hostname" "$results_directory" || return 1
}
# Copy data if not here
if [[ ! -f "$__run_sh__base_path/initial_state.dat" ]]; then
pushd "$__run_sh__base_path" || exit 1
pushd "../../../../tests/TinyEKF/extras/c/" || exit 1
cp ekf_raw.dat "$__run_sh__base_path/initial_state.dat" || exit 1
popd || exit 1
popd || exit 1
fi
main "$@"

@ -1,5 +1,10 @@
#!/bin/bash
command -v imagemagick && {
echo "imagemagick is already installed."
return 0
}
# Installs the deps needed for run.sh
if [ "$(whoami)" == "root" ]; then
apt-get install imagemagick

@ -7,28 +7,10 @@ export PATH="$__run_sh__bash_libraries_absolute_path:$PATH"
source csv_to_dat.sh || exit 1
source framework.sh || exit 1
# source generate_gnuplots.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
declare -ar workloads=(small medium large)
declare -Ar port=(
[small]=10000
[medium]=10001
[large]=10002
)
# Validate that required tools are in path
declare -a required_binaries=(curl)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present."
exit 1
fi
done
}
source validate_dependencies.sh || exit 1
run_functional_tests() {
local hostname="$1"
@ -100,6 +82,7 @@ run_perf_tests() {
local -ir worker_max=10
local -ir batch_size=10
local -i batch_id=0
local pids
echo -n "Perf Tests: "
for workload in "${workloads[@]}"; do
@ -113,7 +96,8 @@ run_perf_tests() {
hey -disable-compression -disable-keepalive -disable-redirects -n $batch_size -c 1 -cpus 1 -t 0 -o csv -m GET -D "shrinking_man_${workload}.jpg" "http://${hostname}:${port[$workload]}" > "$results_directory/${workload}_${batch_id}.csv" 2> /dev/null &
done
wait -f $(pgrep hey | tr '\n' ' ')
pids=$(pgrep hey | tr '\n' ' ')
[[ -n $pids ]] && wait -f $pids
done
printf "[OK]\n"
@ -179,12 +163,19 @@ experiment_main() {
local -r hostname="$1"
local -r results_directory="$2"
validate_dependencies
run_functional_tests "$hostname" "$results_directory" || return 1
run_perf_tests "$hostname" "$results_directory" || return 1
process_results "$results_directory" || return 1
}
validate_dependencies curl
declare -ar workloads=(small medium large)
declare -Ar port=(
[small]=10000
[medium]=10001
[large]=10002
)
main "$@"

@ -1,5 +1,10 @@
#!/bin/bash
command -v imagemagick && {
echo "imagemagick is already installed."
return 0
}
# Installs the deps needed for run.sh
if [ "$(whoami)" == "root" ]; then
apt-get install imagemagick

@ -13,22 +13,7 @@ source framework.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Copy Flower Image if not here
if [[ ! -f "./flower.jpg" ]]; then
cp "$__run_sh__project_base_absolute_path/runtime/tests/sod/bin/flower.jpg" ./flower.jpg
fi
# Validate that required tools are in path
declare -a required_binaries=(curl compare)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present."
exit 1
fi
done
}
source validate_dependencies.sh || exit 1
experiment_main() {
local -r hostname="$1"
@ -71,4 +56,11 @@ experiment_main() {
return 0
}
validate_dependencies curl compare
# Copy Flower Image if not here
if [[ ! -f "./flower.jpg" ]]; then
cp "$__run_sh__project_base_absolute_path/runtime/tests/sod/bin/flower.jpg" ./flower.jpg
fi
main "$@"

@ -7,44 +7,10 @@ export PATH="$__run_sh__bash_libraries_absolute_path:$PATH"
source csv_to_dat.sh || exit 1
source framework.sh || exit 1
# source generate_gnuplots.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
declare -a workloads=(lpd1 lpd2 lpd4)
declare -Ar port=(
[lpd1]=10000
[lpd2]=10001
[lpd4]=10002
)
# Validate that required tools are in path
declare -a required_binaries=(curl)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present."
exit 1
fi
done
}
# Sort the images by the number of labeled plates
declare -a lpd1_images=()
declare -a lpd2_images=()
declare -a lpd4_images=()
while IFS= read -r image_data; do
image_file="${image_data/csv/png}"
# Each line of csv data represents a labeled plate on the image
case $(wc "$image_data" -l | cut -d\ -f1) in
1) lpd1_images+=("$image_file") ;;
2) lpd2_images+=("$image_file") ;;
4) lpd4_images+=("$image_file") ;;
*) panic "Unexpected number of plates" ;;
esac
done < <(ls ./images/*.csv)
source validate_dependencies.sh || exit 1
get_random_image() {
local workload="$1"
@ -139,6 +105,7 @@ run_perf_tests() {
local -ir batch_size=10
local -i batch_id=0
local random_image
local pids
printf "Perf Tests: \n"
for workload in "${workloads[@]}"; do
@ -153,7 +120,8 @@ run_perf_tests() {
get_random_image "$workload" random_image
hey -disable-compression -disable-keepalive -disable-redirects -n $batch_size -c 1 -cpus 1 -t 0 -o csv -m GET -D "${random_image}" "http://${hostname}:${port[$workload]}" > "$results_directory/${workload}_${batch_id}.csv" 2> /dev/null &
done
wait -f $(pgrep hey | tr '\n' ' ')
pids=$(pgrep hey | tr '\n' ' ')
[[ -n $pids ]] && wait -f $pids
done
printf "[OK]\n"
@ -164,8 +132,6 @@ run_perf_tests() {
}
experiment_main() {
validate_dependencies
local -r hostname="$1"
local -r results_directory="$2"
@ -174,4 +140,29 @@ experiment_main() {
process_results "$results_directory" || return 1
}
validate_dependencies curl
declare -a workloads=(lpd1 lpd2 lpd4)
declare -Ar port=(
[lpd1]=10000
[lpd2]=10001
[lpd4]=10002
)
# Sort the images by the number of labeled plates
declare -a lpd1_images=()
declare -a lpd2_images=()
declare -a lpd4_images=()
while IFS= read -r image_data; do
image_file="${image_data/csv/png}"
# Each line of csv data represents a labeled plate on the image
case $(wc "$image_data" -l | cut -d\ -f1) in
1) lpd1_images+=("$image_file") ;;
2) lpd2_images+=("$image_file") ;;
4) lpd4_images+=("$image_file") ;;
*) panic "Unexpected number of plates" ;;
esac
done < <(ls ./images/*.csv)
main "$@"

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true

@ -1,2 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED

@ -7,22 +7,10 @@ export PATH="$__run_sh__bash_libraries_absolute_path:$PATH"
source csv_to_dat.sh || exit 1
source framework.sh || exit 1
# source generate_gnuplots.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Validate that required tools are in path
declare -a required_binaries=(curl shuf pango-view pngtopnm diff)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present."
exit 1
fi
done
}
source validate_dependencies.sh || exit 1
experiment_main() {
local -ri iteration_count=100
@ -39,8 +27,6 @@ experiment_main() {
return 1
fi
validate_dependencies
local -r hostname="$1"
local -r results_directory="$2"
@ -123,4 +109,7 @@ experiment_main() {
csv_to_dat "$results_directory/success.csv" "$results_directory/latency.csv"
}
# Validate that required tools are in path
validate_dependencies curl shuf pango-view pngtopnm diff
main "$@"

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true

@ -1,2 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=false

@ -7,22 +7,10 @@ export PATH="$__run_sh__bash_libraries_absolute_path:$PATH"
source csv_to_dat.sh || exit 1
source framework.sh || exit 1
# source generate_gnuplots.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Validate that required tools are in path
declare -a required_binaries=(curl shuf pango-view pngtopnm diff)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present."
exit 1
fi
done
}
source validate_dependencies.sh || exit 1
experiment_main() {
local -ri iteration_count=100
@ -39,8 +27,6 @@ experiment_main() {
return 1
fi
validate_dependencies
local -r hostname="$1"
local -r results_directory="$2"
@ -127,4 +113,6 @@ experiment_main() {
csv_to_dat "$results_directory/success.csv" "$results_directory/latency.csv"
}
validate_dependencies curl shuf pango-view pngtopnm diff
main "$@"

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true

@ -0,0 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=false

@ -11,18 +11,7 @@ source framework.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Validate that required tools are in path
declare -a required_binaries=(curl shuf pango-view pngtopnm diff)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present."
exit 1
fi
done
}
source validate_dependencies.sh || exit 1
experiment_main() {
local -ir iteration_count=100
@ -39,8 +28,6 @@ experiment_main() {
return 1
fi
validate_dependencies
local -r hostname="$1"
local -r results_directory="$2"
@ -130,4 +117,6 @@ experiment_main() {
csv_to_dat "$results_directory/success.csv" "$results_directory/latency.csv"
}
validate_dependencies curl shuf pango-view pngtopnm diff
main "$@"

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true
SLEDGE_NWORKERS=1

@ -1,4 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED
SLEDGE_NWORKERS=1

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=true
SLEDGE_NWORKERS=1

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_NWORKERS=1

@ -10,24 +10,12 @@ source framework.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Validate that required tools are in path
declare -a required_binaries=(curl)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present." >> "$results_directory/results.txt"
exit 1
fi
done
}
source validate_dependencies.sh || exit 1
experiment_main() {
local -r hostname="$1"
local -r results_directory="$2"
validate_dependencies
local -r expected_result="$(cat ./expected_result.txt)"
local -i success_count=0
@ -61,4 +49,6 @@ experiment_main() {
}
validate_dependencies curl
main "$@"

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true
SLEDGE_NWORKERS=1

@ -1,4 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED
SLEDGE_NWORKERS=1

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=true
SLEDGE_NWORKERS=1

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_NWORKERS=1

@ -10,24 +10,12 @@ source framework.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Validate that required tools are in path
declare -a required_binaries=(curl)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present." >> "$results_directory/results.txt"
exit 1
fi
done
}
source validate_dependencies.sh || exit 1
experiment_main() {
local -r hostname="$1"
local -r results_directory="$2"
validate_dependencies
local -r expected_result="$(cat ./expected_result.txt)"
local -i success_count=0
@ -59,4 +47,6 @@ experiment_main() {
fi
}
validate_dependencies curl
main "$@"

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true
SLEDGE_NWORKERS=1

@ -1,4 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED
SLEDGE_NWORKERS=1

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=true
SLEDGE_NWORKERS=1

@ -1,3 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_NWORKERS=1

@ -10,24 +10,12 @@ source framework.sh || exit 1
source get_result_count.sh || exit 1
source panic.sh || exit 1
source path_join.sh || exit 1
# Validate that required tools are in path
declare -a required_binaries=(curl)
validate_dependencies() {
for required_binary in "${required_binaries[@]}"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present." >> "$results_directory/results.txt"
exit 1
fi
done
}
source validate_dependencies.sh || exit 1
experiment_main() {
local -r hostname="$1"
local -r results_directory="$2"
validate_dependencies
local -r expected_result="$(cat ./expected_result.txt)"
local -i success_count=0
local -ir total_count=10
@ -58,4 +46,6 @@ experiment_main() {
fi
}
validate_dependencies curl
main "$@"

@ -286,10 +286,7 @@ __framework_sh__run_debug() {
}
__framework_sh__run_client() {
experiment_main "$__framework_sh__target" "$RESULTS_DIRECTORY" || {
panic "Error calling experiment_main $RESULTS_DIRECTORY"
return 1
}
experiment_main "$__framework_sh__target" "$RESULTS_DIRECTORY" || return 1
return 0
}
@ -331,13 +328,14 @@ __framework_sh__run_both() {
}
__framework_sh__run_client || {
panic "Error calling __framework_sh__run_client"
__framework_sh__unset_env_file "$envfile"
__framework_sh__stop_runtime
return 1
}
__framework_sh__stop_runtime || {
panic "Error calling __framework_sh__stop_runtime"
__framework_sh__unset_env_file "$envfile"
return 1
}
@ -424,18 +422,18 @@ main() {
;;
esac
exit "$?"
return "$?"
}
__framework_sh__stop_runtime() {
printf "Stopping Runtime: "
# Ignoring RC of 1, as it indicates no matching process
sudo pkill sledgert > /dev/null 2> /dev/null
pkill sledgert > /dev/null 2> /dev/null
(($? > 1)) && {
printf "[ERR]\npkill sledgrt: %d\n" $?
exit 1
}
sudo pkill hey > /dev/null 2> /dev/null
pkill hey > /dev/null 2> /dev/null
(($? > 1)) && {
printf "[ERR]\npkill hey: %d\n" $?
exit 1

@ -0,0 +1,15 @@
# shellcheck shell=bash
if [ -n "$__validate_dependencies_sh__" ]; then return; fi
__validate_dependencies_sh__=$(date)
validate_dependencies() {
for required_binary in "$@"; do
if ! command -v "$required_binary" > /dev/null; then
echo "$required_binary is not present."
return 1
fi
done
return 0
}

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true

@ -0,0 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=true

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=false

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true

@ -0,0 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED

@ -1 +0,0 @@
SLEDGE_SCHEDULER=FIFO

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=true

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=false

@ -128,6 +128,7 @@ run_experiments() {
local -i roll=0
local -ir total_iterations=1000
local -ir worker_max=50
local pids
printf "Running Experiments: "
@ -146,7 +147,8 @@ run_experiments() {
fi
done
done
wait -f $(pgrep hey | tr '\n' ' ')
pids=$(pgrep hey | tr '\n' ' ')
[[ -n $pids ]] && wait -f $pids
printf "[OK]\n"
for workload in "${workloads[@]}"; do

@ -68,7 +68,7 @@ ocr_by_word() {
make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/by_word" || exit 1
./install.sh || exit 1
# ./install.sh || exit 1
./run.sh || failed_tests+=("ocr_by_word")
popd || exit 1
return 0
@ -79,7 +79,7 @@ ocr_by_font() {
make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/by_font" || exit 1
./install.sh || exit 1
# ./install.sh || exit 1
./run.sh || failed_tests+=("ocr_by_font")
popd || exit 1
return 0
@ -90,7 +90,7 @@ ocr_by_dpi() {
make gocr -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ocr/by_dpi" || exit 1
./install.sh || exit 1
# ./install.sh || exit 1
./run.sh || failed_tests+=("ocr_by_dpi")
popd || exit 1
return 0
@ -102,7 +102,7 @@ ekf_by_iteration() {
make tinyekf -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/ekf/by_iteration" || exit 1
./run.sh || failed_tests+=("ocr_by_dpi")
./run.sh || failed_tests+=("ekf_by_iteration")
popd || exit 1
return 0
}
@ -133,7 +133,7 @@ image_resize() {
make sod -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/imageresize/test" || exit 1
./install.sh || exit 1
# ./install.sh || exit 1
./run.sh || failed_tests+=("image_resize")
popd || exit 1
return 0
@ -144,7 +144,7 @@ image_resize_by_resolution() {
make sod -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/applications/imageresize/by_resolution" || exit 1
./install.sh || exit 1
# ./install.sh || exit 1
./run.sh || failed_tests+=("image_resize_resolution")
popd || exit 1
return 0
@ -166,7 +166,7 @@ bimodal() {
make rttests -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/bimodal/" || exit 1
./install.sh || exit 1
# ./install.sh || exit 1
./run.sh || failed_tests+=("bimodal")
popd || exit 1
return 0
@ -178,7 +178,7 @@ concurrency() {
make rttests -C "$base_dir/runtime/tests" || exit 1
fi
pushd "$base_dir/runtime/experiments/concurrency/" || exit 1
./install.sh || exit 1
# ./install.sh || exit 1
./run.sh || failed_tests+=("concurrency")
popd || exit 1
return 0
@ -194,7 +194,7 @@ payload() {
fi
# TODO: Make Dependency "work1k_wasm.so" "work10k_wasm.so" "work100k_wasm.so" "work1m_wasm.so"
pushd "$base_dir/runtime/experiments/payload/" || exit 1
./install.sh || exit 1
# ./install.sh || exit 1
./run.sh || failed_tests+=("payload")
popd || exit 1
return 0
@ -207,6 +207,7 @@ main() {
if (($# == 0)); then
# If no arguments are provided, run all tests
for test in "${tests[@]}"; do
echo "[[$test]]"
"$test"
done

Loading…
Cancel
Save