firesim/deploy/workloads/run-bw-test.sh

51 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# run the bw test using the manager. optionally passing "withlaunch" will also
# automatically launch the appropriate runfarm
#
# the runfarm WILL NOT be terminated upon completion
trap "exit" INT
set -e
set -o pipefail
if [ "$1" == "withlaunch" ]; then
firesim launchrunfarm -c workloads/bw-test-config.ini
fi
ORIGDIR=$(pwd)
cd ../../
git apply $ORIGDIR/bw-test/switchpatch.patch
cd $ORIGDIR
bandwidths=( 1 10 40 100 )
cd ../results-workload
# create the aggregate results directory
resultsdir=$(date +"%Y-%m-%d--%H-%M-%S")-bw-test-aggregate
mkdir $resultsdir
# make sure we don't get the same name as one of the manager produced results
# directories
sleep 2
for i in "${bandwidths[@]}"
do
firesim infrasetup -c workloads/bw-test-config.ini
firesim runworkload -c workloads/bw-test-config.ini --overrideconfigdata "targetconfig netbandwidth $i"
# rename the output directory with the net bandwidth
files=(*bw-test*)
originalfilename=${files[-1]}
mv $originalfilename $resultsdir/$i
done
python $ORIGDIR/bw-test/bw-test-graph.py $(pwd)/$resultsdir
cd $ORIGDIR
cd ../../
git apply -R $ORIGDIR/bw-test/switchpatch.patch
firesim terminaterunfarm -c workloads/bw-test-config.ini --forceterminate