-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyeclib-reconstruct-microbench.sh
More file actions
executable file
·45 lines (38 loc) · 1.67 KB
/
pyeclib-reconstruct-microbench.sh
File metadata and controls
executable file
·45 lines (38 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/bash
###############################################################################
# microbench.sh #
# #
# Benchmarks a GRPC enabled encoder/decoder implementing the behaviour #
# defined in playclcoud.proto. #
###############################################################################
source ./utils.sh
function print_usage {
echo -e "Usage: ${0} <env-file> <repetitions>\n"
echo -e "Arguments:"
echo -e "\tenv-file Environment file containing the values that should be used by the encoder/decoder"
echo -e "\trepetitions Number of repetitions"
}
if [[ "${#}" -ne 2 ]]; then
print_usage
exit 0
fi
ENV_FILE="${1}"
ENV_FILE_CONTENT="$(cat "${ENV_FILE}")"
REPETITIONS="${2}"
source "${ENV_FILE}"
DATA_DIRECTORY="xpdata/pyeclib/$(basename "${EC_TYPE}")/"
declare -a SIZES=("4" "16" "64")
cp pycoder/pylonghair_driver.py microbencher/pylonghair_driver.py
cp pycoder/custom_driver.py microbencher/custom_driver.py
cp pycoder/__init__.py microbencher/__init__.py
cd microbencher
docker build -t pyeclib-microbencher -f pyeclib.Dockerfile .
cd -
mkdir -p "${DATA_DIRECTORY}"
for size in "${SIZES[@]}"; do
ADJUSTED_SIZE="$((size * 1024 * 1024))"
for rep in $(seq "${REPETITIONS}"); do
docker run -it --rm -v "${PWD}/xpdata/pyeclib":/opt/xpdata/pyeclib pyeclib-microbencher \
bash -c "eval ${ENV_FILE_CONTENT} && /usr/local/src/app/microbench_local_reconstruct.py ${ADJUSTED_SIZE} > /opt/$DATA_DIRECTORY/microbench-reconstruct-${size}MB-${rep}.dat"
done
done