mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Added different tests which are automatically dispatched
This commit is contained in:
parent
3c0606740a
commit
8a7c96feae
1 changed files with 82 additions and 45 deletions
|
@ -10,8 +10,7 @@
|
|||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# any later version.
|
||||
# the Free Software Foundation, either version 3 of the License, or any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
|
@ -39,32 +38,48 @@ SCRIPT=$(realpath $0)
|
|||
SCRIPTPATH=$(dirname ${SCRIPT})
|
||||
source ${SCRIPTPATH}/../tools/integration-tests-helper.sh
|
||||
|
||||
|
||||
CONFIG_FILE=$(mktemp /tmp/ib-configuration-XXXX.conf)
|
||||
CONFIG_FILE_TARGET=$(mktemp /tmp/ib-configuration-target-XXXX.conf)
|
||||
CONFIG_FILE_SOURCE=$(mktemp /tmp/ib-configuration-source-XXXX.conf)
|
||||
INPUT_FILE=$(mktemp)
|
||||
LOG_DIR=benchmarks_$(date +%Y%m%d_%H-%M-%S)
|
||||
mkdir ${LOG_DIR}
|
||||
|
||||
NUM_VALUES=5
|
||||
RATE_SAMPLES=10000
|
||||
NUM_SAMPLES=100000
|
||||
NUM_VALUES=(3 5 10 25 50)
|
||||
RATE_SAMPLES=(10 100 1000 10000 100000 200000)
|
||||
TIME_TO_RUN=30
|
||||
|
||||
# Declare modes
|
||||
MODES=("TCP" "UDP")
|
||||
|
||||
|
||||
# Initialize counter
|
||||
COUNT=0
|
||||
|
||||
# Set config file with a MODE flag
|
||||
# NUM_VALUES, RATE_SAMPLES, NUM_SAMPLES, and MODE will be replaced in loop
|
||||
cat > ${CONFIG_FILE} <<EOF
|
||||
logging = {
|
||||
level = 0,
|
||||
facilities = "ib",
|
||||
}
|
||||
|
||||
nodes = {
|
||||
siggen = {
|
||||
type = "signal",
|
||||
|
||||
signal = "mixed",
|
||||
values = ${NUM_VALUES},
|
||||
values = NUM_VALUES,
|
||||
frequency = 3,
|
||||
rate = ${RATE_SAMPLES},
|
||||
limit = ${NUM_SAMPLES},
|
||||
rate = RATE_SAMPLES,
|
||||
limit = NUM_SAMPLES,
|
||||
},
|
||||
|
||||
results = {
|
||||
type = "file",
|
||||
|
||||
uri = "logs/ib_results-%Y%m%d_%H-%M-%S.log",
|
||||
uri = "${LOG_DIR}/COUNT_MODE-NUM_VALUES-RATE_SAMPLES-NUM_SAMPLES.log",
|
||||
},
|
||||
|
||||
ib_node_source = {
|
||||
|
@ -135,52 +150,74 @@ paths = (
|
|||
)
|
||||
EOF
|
||||
|
||||
# Declare modes
|
||||
MODES=("TCP" "UDP")
|
||||
|
||||
# Run through modes
|
||||
for MODE in "${MODES[@]}"
|
||||
do
|
||||
for NUM_VALUE in "${NUM_VALUES[@]}"
|
||||
do
|
||||
for RATE_SAMPLE in "${RATE_SAMPLES[@]}"
|
||||
do
|
||||
NUM_SAMPLE=$((${RATE_SAMPLE} * ${TIME_TO_RUN}))
|
||||
|
||||
echo "#############################"
|
||||
echo "#############################"
|
||||
echo "## START ${MODE} ##"
|
||||
echo "#############################"
|
||||
echo "#############################"
|
||||
echo "########################################################"
|
||||
echo "########################################################"
|
||||
echo "## START ${MODE}"
|
||||
echo "## NUM_VALUES: ${NUM_VALUE}"
|
||||
echo "## RATE_SAMPLES: ${RATE_SAMPLE}"
|
||||
echo "## NUM_SAMPLES: ${NUM_SAMPLE}"
|
||||
echo "########################################################"
|
||||
echo "########################################################"
|
||||
|
||||
sed -i -e 's/RDMA_PS_MODE/RDMA_PS_'${MODE}'/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/COUNT/'${COUNT}'/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/MODE/'${MODE}'/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/NUM_VALUES/'${NUM_VALUE}'/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/RATE_SAMPLES/'${RATE_SAMPLE}'/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/NUM_SAMPLES/'${NUM_SAMPLE}'/g' ${CONFIG_FILE}
|
||||
|
||||
# Start receiving node
|
||||
VILLAS_LOG_PREFIX=$(colorize "[Target Node] ") \
|
||||
villas-node ${CONFIG_FILE_TARGET} &
|
||||
target_node_proc=$!
|
||||
|
||||
# Wait for node to complete init
|
||||
sleep 2
|
||||
|
||||
# Start sending pipe
|
||||
VILLAS_LOG_PREFIX=$(colorize "[Source Node] ") \
|
||||
ip netns exec namespace0 villas-node ${CONFIG_FILE_SOURCE} &
|
||||
source_node_proc=$!
|
||||
|
||||
sleep $((${TIME_TO_RUN} + 1))
|
||||
|
||||
# Stop node
|
||||
kill $target_node_proc
|
||||
|
||||
sleep 3
|
||||
#ToDo: Add checks
|
||||
|
||||
# Start receiving node
|
||||
VILLAS_LOG_PREFIX=$(colorize "[Target Node] ") \
|
||||
villas-node ${CONFIG_FILE_TARGET} &
|
||||
target_node_proc=$!
|
||||
|
||||
# Wait for node to complete init
|
||||
sleep 1
|
||||
|
||||
# Start sending pipe
|
||||
VILLAS_LOG_PREFIX=$(colorize "[Source Node] ") \
|
||||
ip netns exec namespace0 villas-node ${CONFIG_FILE_SOURCE} &
|
||||
source_node_proc=$!
|
||||
|
||||
sleep $((${NUM_SAMPLES} / ${RATE_SAMPLES} + 1))
|
||||
|
||||
# Stop node
|
||||
kill $target_node_proc
|
||||
|
||||
sleep 3
|
||||
#ToDo: Add checks
|
||||
echo "########################################################"
|
||||
echo "## STOP $MODE"-${NUM_VALUE}-${RATE_SAMPLE}-${NUM_SAMPLE}
|
||||
echo "########################################################"
|
||||
echo ""
|
||||
|
||||
echo "#############################"
|
||||
echo "#############################"
|
||||
echo "## STOP $MODE ##"
|
||||
echo "#############################"
|
||||
echo "#############################"
|
||||
echo ""
|
||||
sed -i -e 's/\/'${COUNT}'_/\/COUNT_/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/'${MODE}'/MODE/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/values\ =\ '${NUM_VALUE}'/values\ =\ NUM_VALUES/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/rate\ =\ '${RATE_SAMPLE}'/rate\ =\ RATE_SAMPLES/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/limit\ =\ '${NUM_SAMPLE}'/limit\ =\ NUM_SAMPLES/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/-'${NUM_VALUE}'/-NUM_VALUES/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/-'${RATE_SAMPLE}'/-RATE_SAMPLES/g' ${CONFIG_FILE}
|
||||
sed -i -e 's/-'${NUM_SAMPLE}'/-NUM_SAMPLES/g' ${CONFIG_FILE}
|
||||
|
||||
sed -i -e 's/RDMA_PS_'${MODE}'/RDMA_PS_MODE/g' ${CONFIG_FILE}
|
||||
((COUNT++))
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
# Since this script will be executed as sudo we should chmod the
|
||||
# log dir 777. Otherwise too many unnecessary 'sudo rm -rf' will be called.
|
||||
chmod -R 777 ${LOG_DIR}
|
||||
|
||||
rm ${CONFIG_FILE} ${CONFIG_FILE_TARGET} ${CONFIG_FILE_SOURCE} ${INPUT_FILE}
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Add table
Reference in a new issue