summaryrefslogtreecommitdiffstats
path: root/run_bench.sh
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2021-10-26 00:07:19 -0400
committerleochanj105 <leochanj@live.unc.edu>2021-10-26 00:07:19 -0400
commit95b383ce406872937fb810ac1f8b8a17ef887429 (patch)
tree63b9be99c2fcbeac9c3f6d2992ac37c69124ee2f /run_bench.sh
parent65ea49f13da3e20c6e0a5c0a8a4432d6b61f7674 (diff)
fixed power issue and extra.h first job issue
Diffstat (limited to 'run_bench.sh')
-rwxr-xr-xrun_bench.sh39
1 files changed, 30 insertions, 9 deletions
diff --git a/run_bench.sh b/run_bench.sh
index 39e9dcb..242d987 100755
--- a/run_bench.sh
+++ b/run_bench.sh
@@ -11,7 +11,7 @@
11# - L2+L3 cache splitting (if OS supported) 11# - L2+L3 cache splitting (if OS supported)
12 12
13if grep -q "#define LITMUS 1" ../extra.h ./extra.h 2> /dev/null; then 13if grep -q "#define LITMUS 1" ../extra.h ./extra.h 2> /dev/null; then
14 LITMUS=1 14LITMUS=1
15fi 15fi
16 16
17if [ $# -lt 5 ]; then 17if [ $# -lt 5 ]; then
@@ -174,7 +174,7 @@ do
174 fi 174 fi
175 i=$(( $i + 1 )) 175 i=$(( $i + 1 ))
176done 176done
177 177
178echo "Done. Creating cleanup handler..." 178echo "Done. Creating cleanup handler..."
179function cleanup { 179function cleanup {
180 # End contending tasks 180 # End contending tasks
@@ -327,8 +327,16 @@ FAIL_COLOR="\033[0;31m"
327GOOD_COLOR="\033[0;32m" 327GOOD_COLOR="\033[0;32m"
328RESET_COLOR="\033[0m" 328RESET_COLOR="\033[0m"
329 329
330
330# For each benchmark 331# For each benchmark
331for (( i = 0; i < ${#bench[@]} ; i++ )); do 332for (( i = 0; i < ${#bench[@]} ; i++ )); do
333 # PERIOD="1000"
334
335 # if [[ "${bench[$i]}" == "multi_ncut_qcif" ]]; then
336 # PERIOD="10000"
337 # echo "-------------${bench[$i]}------------------"
338 # fi
339
332 # Search for the benchmark in this directory, than /bin 340 # Search for the benchmark in this directory, than /bin
333 if [[ -f ${bench[$i]} ]]; then 341 if [[ -f ${bench[$i]} ]]; then
334 prefix="." 342 prefix="."
@@ -338,8 +346,13 @@ for (( i = 0; i < ${#bench[@]} ; i++ )); do
338 if [[ "$mode" == "base" ]]; then 346 if [[ "$mode" == "base" ]]; then
339 # Just run the benchmark if TACLeBench 347 # Just run the benchmark if TACLeBench
340 # Check if we're using LITMUS^RT or not 348 # Check if we're using LITMUS^RT or not
341 if [[ -v $LITMUS ]]; then 349 if [[ -v LITMUS ]]; then
342 echo "${input[$i]}" | numactl $numa_arg0 $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $runID-$userRunID 1 350 # echo "numactl $numa_arg0 $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $runID-$userRunID 1 $PERIOD 1 0"
351 echo "${input[$i]}" | numactl $numa_arg0 $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $runID-$userRunID 1 $PERIOD 1 0 & PID1=$!
352 # sudo /home/ae/liblitmus/release_ts
353 # echo "waiting......"
354 # wait $PID1
355 # exit 0
343 else 356 else
344 # Remember: Unpaired tasks always get access to all colors (so we --interleave all) 357 # Remember: Unpaired tasks always get access to all colors (so we --interleave all)
345 echo "${input[$i]}" | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $runID-$userRunID 1 358 echo "${input[$i]}" | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $runID-$userRunID 1
@@ -349,7 +362,7 @@ for (( i = 0; i < ${#bench[@]} ; i++ )); do
349 while read j; do # For cache setting 362 while read j; do # For cache setting
350 echo $j > /sys/fs/resctrl/benchmarks/schemata 363 echo $j > /sys/fs/resctrl/benchmarks/schemata
351 while read ii; do # For WSS setting 364 while read ii; do # For WSS setting
352 if [[ -v $LITMUS ]]; then 365 if [[ -v LITMUS ]]; then
353 ./gen_input.py ${bench[$i]} inputs/${bench[$i]^}/$template_input $ii | numactl $numa_arg0 $prefix/${bench[$i]} $bench{[$i]}-$ii-$j $maxJobs $core $runID-$userRunID 1 366 ./gen_input.py ${bench[$i]} inputs/${bench[$i]^}/$template_input $ii | numactl $numa_arg0 $prefix/${bench[$i]} $bench{[$i]}-$ii-$j $maxJobs $core $runID-$userRunID 1
354 else 367 else
355 ./gen_input.py ${bench[$i]} inputs/${bench[$i]^}/$template_input $ii | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]}-$ii-$j $maxJobs $core $runID-$userRunID 1 368 ./gen_input.py ${bench[$i]} inputs/${bench[$i]^}/$template_input $ii | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]}-$ii-$j $maxJobs $core $runID-$userRunID 1
@@ -364,11 +377,19 @@ for (( i = 0; i < ${#bench[@]} ; i++ )); do
364 start=0 377 start=0
365 fi 378 fi
366 for (( j = $start; j < ${#bench[@]} ; j++ )); do 379 for (( j = $start; j < ${#bench[@]} ; j++ )); do
380 # PERIOD="1000"
381 # if [[ "${bench[$i]}" == "multi_ncut_qcif" || "${bench[$j]}" == "multi_ncut_qcif" ]]; then
382 # PERIOD="20000"
383 # echo "-------------${bench[$i]}---------${bench[$j]}---------"
384 # fi
367 if [[ ! -v async ]]; then 385 if [[ ! -v async ]]; then
368 # Synchronize between pairs - original hard real-time SMT approach 386 # Synchronize between pairs - original hard real-time SMT approach
369 if [[ -v $LITMUS ]]; then 387 if [[ -v LITMUS ]]; then
370 echo "${input[$i]}" | numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $core_two ${bench[$j]} $runID-$userRunID-A 1 & PID1=$!; 388 # echo "numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $core_two ${bench[$j]} $runID-$userRunID-A 1 $PERIOD 1 0 & PID1=$!;"
371 echo "${input[$j]}" | numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$j]} ${bench[$j]} $maxJobs $core_two $core ${bench[$i]} $runID-$userRunID-B 1 & PID2=$!; 389 # echo "numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$j]} ${bench[$j]} $maxJobs $core_two $core ${bench[$i]} $runID-$userRunID-B 1 $PERIOD 1 0 & PID2=$!;"
390 echo "${input[$i]}" | numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $core_two ${bench[$j]} $runID-$userRunID-A 1 $PERIOD 1 0 & PID1=$!;
391 echo "${input[$j]}" | numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$j]} ${bench[$j]} $maxJobs $core_two $core ${bench[$i]} $runID-$userRunID-B 1 $PERIOD 1 0 & PID2=$!;
392 # sudo /home/ae/liblitmus/release_ts
372 else 393 else
373 echo "${input[$i]}" | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $core_two ${bench[$j]} $runID-$userRunID-A 1 & PID1=$!; 394 echo "${input[$i]}" | chrt -r 97 numactl $numa_arg0 taskset -c $core $prefix/${bench[$i]} ${bench[$i]} $maxJobs $core $core_two ${bench[$j]} $runID-$userRunID-A 1 & PID1=$!;
374 echo "${input[$j]}" | chrt -r 97 numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$j]} ${bench[$j]} $maxJobs $core_two $core ${bench[$i]} $runID-$userRunID-B 1 & PID2=$!; 395 echo "${input[$j]}" | chrt -r 97 numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$j]} ${bench[$j]} $maxJobs $core_two $core ${bench[$i]} $runID-$userRunID-B 1 & PID2=$!;
@@ -377,7 +398,7 @@ for (( i = 0; i < ${#bench[@]} ; i++ )); do
377 wait $PID1 $PID2 398 wait $PID1 $PID2
378 else 399 else
379 # No synchronization between pairs - original soft real-time SMT approach 400 # No synchronization between pairs - original soft real-time SMT approach
380 if [[ -v $LITMUS ]]; then 401 if [[ -v LITMUS ]]; then
381 echo "${input[$j]}" | numactl $numa_arg0 taskset -c $core $prefix/${bench[$j]} ${bench[$j]} -1 $core NULL 0 & PID1=$!; 402 echo "${input[$j]}" | numactl $numa_arg0 taskset -c $core $prefix/${bench[$j]} ${bench[$j]} -1 $core NULL 0 & PID1=$!;
382 echo "${input[$i]}" | numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$i]} ${bench[$i]}"+"${bench[$j]} $maxJobs $core_two $runID-$userRunID 1 & PID2=$!; 403 echo "${input[$i]}" | numactl $numa_arg1 taskset -c $core_two $prefix/${bench[$i]} ${bench[$i]}"+"${bench[$j]} $maxJobs $core_two $runID-$userRunID 1 & PID2=$!;
383 else 404 else