-
Notifications
You must be signed in to change notification settings - Fork 202
/
pft
executable file
·70 lines (62 loc) · 1.63 KB
/
pft
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
68
69
#!/bin/sh
# - runtime
# - nr_task
# - iterations
# - test_memory_size
## Page Fault Test
# This test run in different mode, and the mode is determined by
# the combination of parameters. The valid combinations are as
# follows in which the smaller index has higher priority:
# 1. iterations
# 2. nr_task, runtime
# 3. nr_task, iterations
cd "$BENCHMARK_ROOT/pft" || exit
. "$LKP_SRC/lib/unit.sh"
. "$LKP_SRC/lib/sysinfo.sh"
. "$LKP_SRC/lib/reproduce-log.sh"
if [ -z "$test_memory_size" ]; then
memory=$(to_byte "$memory")
pft_mapping_size=$((memory / 5))
else
pft_mapping_size=$test_memory_size
fi
if [ -z "$nr_task" ]; then
[ -n "$iterations" ] || {
echo "Error: Please specify iterations if nr_task is not specified." >&2
exit 1
}
setup_threads_to_iterate
for clients in $threads_to_iterate
do
echo "Clients: $clients"
for iteration in $(seq 1 "$iterations")
do
echo "Iteration: $iteration"
log_test ./pft -m "$pft_mapping_size" -n "$clients" -F
done
done
elif [ -n "$runtime" ]; then
iteration=1
start_time=$(date +%s)
echo "Clients: $nr_task"
while :; do
echo "Iteration: $iteration"
log_test ./pft -m "$pft_mapping_size" -n "$nr_task" -F
now=$(date +%s)
[ $((now - start_time)) -gt "$runtime" ] && break
iteration=$((iteration + 1))
done
elif [ -n "$iterations" ]; then
echo "Clients: $nr_task"
for iteration in $(seq 1 "$iterations")
do
echo "Iteration: $iteration"
log_test ./pft -m "$pft_mapping_size" -n "$nr_task" -F
done
else
echo "Error: Please specify the correct combination of parameters which is shown in following:
1. iterations
2. nr_task, runtime
3. nr_task, iterations" >&2
exit 1
fi