-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun_traces.sh
35 lines (31 loc) · 1.06 KB
/
run_traces.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
#!/bin/bash
make clean
make
FILE="benchmarks.txt"
rm results.log output_lru.log output_crc.log
let c=1
while IFS= read line
do
echo "################## BENCHMARK NUMBER $c ##############################"
# Running LRU Policy
export DAN_POLICY=0;
./efectiu traces/"$line.trace.gz" > output_lru.log
# Now extract IPC from output.txt
lru_mpki=$(tail -2 output_lru.log | head -n 1 | awk -F" " '/./{line=$5} END{print line}')
last_line=$(awk '/./{line=$0} END{print line}' output_lru.log)
arr=($last_line)
lru_ipc=${arr[2]}
echo "LRU IPC for $line = $lru_ipc"
# Running CONTESTANT Policy
export DAN_POLICY=2;
./efectiu traces/"$line.trace.gz" > output_crc.log
# Now extract IPC from output.txt
crc_mpki=$(tail -2 output_crc.log | head -n 1 | awk -F" " '/./{line=$5} END{print line}')
last_line=$(awk '/./{line=$0} END{print line}' output_crc.log)
arr=($last_line)
my_ipc=${arr[2]}
echo "CRC IPC for $line = $my_ipc"
echo "$line $lru_mpki $crc_mpki $lru_ipc $my_ipc" >> results.log
c=$((c + 1));
done < "$FILE"
python calc_gmean.py