-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_shootout.sh
executable file
·36 lines (31 loc) · 1.11 KB
/
run_shootout.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
function run_shootout() {
RUN_PREFIX="$1"
OUTPUT_NAME="$2"
for f in data_feeds*.pcap; do
echo "$f" >> "$OUTPUT_NAME"
echo $RUN_PREFIX ./target/release/md_shootout -f "$f"
sudo $RUN_PREFIX ./target/release/md_shootout -f "$f" >> "$OUTPUT_NAME"
done
}
PREFIXES=(
"|shootout_normal.txt" # No CPU Pinning
"taskset 2|shootout_taskset.txt" # Pin to CPU 1
"taskset 2 nice -n-19|shootout_nice.txt" # Pin to CPU 2 with highest priority
# Kinda dangerous, caused the processor to lock when running in graphical session,
# but seemed OK in runlevel 3 until the kernel switched time sources
#"taskset 2 chrt -f 99|shootout_chrt.txt" # Pin to CPU 3 with real-time priority
)
RUN_COUNT=10
for prefix in "${PREFIXES[@]}"; do
(
RUN_PREFIX="$(echo "$prefix" | cut -d'|' -f1)"
OUTPUT_NAME="$(echo "$prefix" | cut -d'|' -f2)"
rm "$OUTPUT_NAME"
for i in $(seq 1 $RUN_COUNT); do
run_shootout "$RUN_PREFIX" "$OUTPUT_NAME"
done
)
wait
done