-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3__measure_single.sh
executable file
·68 lines (51 loc) · 1.08 KB
/
3__measure_single.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
#parse parameters
if [ $# -lt 3 ]; then
echo "Invalid arguments." >&2
exit 2
fi
TESTENV="$1"
TESTNAME="$2"
shift
shift
#create directory for test results
mkdir -p "${TESTENV}"
#wait for test to begin
printf "%s\n" "$TESTENV"
printf "%s\n" "$TESTNAME"
echo
echo
echo "press key to start test (when temperature back at normal level)"
echo
echo
echo
echo
read FOO
#start measuring programs
turbostat --num_iterations 36 --out "${TESTENV}/${TESTNAME}.turbostat" 2>&1 &
timeout 180 intel_gpu_top -o "${TESTENV}/${TESTNAME}.intel_gpu_top" &
powertop -t 5 -i 36 --csv="${TESTENV}/${TESTNAME}.powertop.csv" > /dev/null 2> /dev/null &
timeout 180 stdbuf -oL sh -c "while true; do sleep 1; sensors; done | grep '^Core\|^Package' > '${TESTENV}/${TESTNAME}.temp'" &
#start test program
echo
echo
echo warmup+main: 2min
echo
echo
eval timeout 120 $*
beep
#wait cooldown phase
echo
echo
echo cooldown: 1min
sleep 60
beep ; beep ; beep
#waiting for all jobs to finish
while jobs -r | grep -q . ; do #only works with bash
echo waiting for jobs to finish
sleep 2
done
echo
echo
echo
echo