diff options
| author | Joshua Bakita <jbakita@cs.unc.edu> | 2021-03-11 18:03:17 -0500 |
|---|---|---|
| committer | Joshua Bakita <jbakita@cs.unc.edu> | 2021-03-11 18:03:17 -0500 |
| commit | a338d68b02f6adce29b8b161974b67a1dbb37513 (patch) | |
| tree | ab52bbdd469e06e984dae4954083702fcf2ec96b /run_bench.sh | |
| parent | b16e25d69337b4b2353715e83b615254110a5196 (diff) | |
Benchmarks: Automatically detect which cores to run contenders on
Diffstat (limited to 'run_bench.sh')
| -rwxr-xr-x | run_bench.sh | 21 |
1 files changed, 13 insertions, 8 deletions
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..." | |||
| 304 | read | 304 | read |
| 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 | ||
| 307 | if [[ -v contend ]]; then | 308 | if [[ -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 | ||
| 316 | fi | 321 | fi |
| 317 | sleep 1 # Wait for contending tasks to start | 322 | sleep 1 # Wait for contending tasks to start |
| 318 | echo "Done. Beginning benchmarks..." | 323 | echo "Done. Beginning benchmarks..." |
