summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2021-03-11 18:03:17 -0500
committerJoshua Bakita <jbakita@cs.unc.edu>2021-03-11 18:03:17 -0500
commita338d68b02f6adce29b8b161974b67a1dbb37513 (patch)
treeab52bbdd469e06e984dae4954083702fcf2ec96b
parentb16e25d69337b4b2353715e83b615254110a5196 (diff)
Benchmarks: Automatically detect which cores to run contenders on
-rw-r--r--dis/run_pair_convexity.sh21
-rwxr-xr-xrun_bench.sh21
2 files changed, 26 insertions, 16 deletions
diff --git a/dis/run_pair_convexity.sh b/dis/run_pair_convexity.sh
index bdd25c8..6ef244b 100644
--- a/dis/run_pair_convexity.sh
+++ b/dis/run_pair_convexity.sh
@@ -121,15 +121,20 @@ echo "Press enter to confirm environment, Ctrl-C to exit..."
121read 121read
122 122
123# Start contending tasks 123# Start contending tasks
124# If we're on CPU 15, this would launch contenders on CPUs 0, 1, 4, 5, 8, and 9
124if [[ $8 == "--contend" ]]; then 125if [[ $8 == "--contend" ]]; then
125 echo "Done. Starting 6 contending tasks..." 126 echo "Done. Starting contending tasks on other CCXes..."
126 # Run two contending tasks on each other CCX 127 num_phys_cores=$(grep -m 1 "cpu cores" /proc/cpuinfo | cut -d " " -f 3)
127 taskset -c 1 ../thrasher/thrasher & 128 # For each set of 4 cores (CCX)
128 taskset -c 2 ../thrasher/thrasher & 129 for (( i = 0; i < ${num_phys_cores} ; i += 4 )); do
129 taskset -c 5 ../thrasher/thrasher & 130 # Don't run contending tasks on the CCX we're benchmarking
130 taskset -c 6 ../thrasher/thrasher & 131 if (($firstCore / 4 == $i / 4)); then
131 taskset -c 9 ../thrasher/thrasher & 132 continue
132 taskset -c 10 ../thrasher/thrasher & 133 fi
134 # Otherwise launch on the other two
135 taskset -c $i ../thrasher/thrasher &
136 taskset -c $(($i+1)) ../thrasher/thrasher &
137 done
133fi 138fi
134sleep 1 # Wait for contending tasks to start 139sleep 1 # Wait for contending tasks to start
135echo "Done. Beginning benchmarks..." 140echo "Done. Beginning benchmarks..."
diff --git a/run_bench.sh b/run_bench.sh
index cf94719..6e4abb5 100755
--- a/run_bench.sh
+++ b/run_bench.sh
@@ -304,15 +304,20 @@ echo "Press enter to confirm environment, Ctrl-C to exit..."
304read 304read
305 305
306# Start contending tasks 306# Start contending tasks
307# If we're on CPU 15, this would launch contenders on CPUs 0, 1, 4, 5, 8, and 9
307if [[ -v contend ]]; then 308if [[ -v contend ]]; then
308 echo "Done. Starting 6 contending tasks..." 309 echo "Done. Starting contending tasks on other CCXes..."
309 # Run two contending tasks on each other CCX 310 num_phys_cores=$(grep -m 1 "cpu cores" /proc/cpuinfo | cut -d " " -f 3)
310 taskset -c 1 ../thrasher/thrasher & 311 # For each set of 4 cores (CCX)
311 taskset -c 2 ../thrasher/thrasher & 312 for (( i = 0; i < ${num_phys_cores} ; i += 4 )); do
312 taskset -c 5 ../thrasher/thrasher & 313 # Don't run contending tasks on the CCX we're benchmarking
313 taskset -c 6 ../thrasher/thrasher & 314 if (($core / 4 == $i / 4)); then
314 taskset -c 9 ../thrasher/thrasher & 315 continue
315 taskset -c 10 ../thrasher/thrasher & 316 fi
317 # Otherwise launch on the other two
318 taskset -c $i ../thrasher/thrasher &
319 taskset -c $(($i+1)) ../thrasher/thrasher &
320 done
316fi 321fi
317sleep 1 # Wait for contending tasks to start 322sleep 1 # Wait for contending tasks to start
318echo "Done. Beginning benchmarks..." 323echo "Done. Beginning benchmarks..."