forked from c3sr/scope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuma-separate-process.sh
executable file
·127 lines (104 loc) · 2.68 KB
/
numa-separate-process.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#! /bin/bash
# Run all NUMA benchmarks in their own process
set -eou pipefail -x
# Which machine to use (s822lc, ac922, or dgx)
machine=$1
# Path to bench executable
BENCH=$2
if [ -z ${3+x} ]; then
OUT_DIR="."
else
OUT_DIR="$3"
fi
s822lc_gpus=( 0 1 2 3 )
s822lc_numas=( 0 1 )
ac922_gpus=( 0 1 2 3 )
ac922_numas=( 0 8 )
dgx_gpus=( 0 1 2 3 4 5 6 7 )
dgx_numas=( 0 1 )
numas=$machine\_numas[@]
gpus=$machine\_gpus[@]
shared_bmarks=(
noop
)
numa_numa_bmarks=(
NUMA_Memcpy_HostToPinned
#NUMA_WR
#NUMA_RD
noop
)
numa_gpu_gpu_bmarks=(
NUMA_Memcpy_GPUToGPU
noop
)
gpu_gpu_bmarks=(
CUDA_Memcpy_GPUToGPU
UM_Coherence_GPUToGPU
UM_Prefetch_GPUToGPU
noop
)
numa_gpu_bmarks=(
NUMA_Memcpy_GPUToHost
NUMA_Memcpy_GPUToPinned
NUMA_Memcpy_GPUToWC
NUMA_Memcpy_HostToGPU
NUMA_Memcpy_PinnedToGPU
NUMA_Memcpy_WCToGPU
NUMAUM_Coherence_GPUToHost
NUMAUM_Coherence_HostToGPU
NUMAUM_Latency_GPUToHost
NUMAUM_Latency_HostToGPU
NUMAUM_Prefetch_GPUToHost
NUMAUM_Prefetch_HostToGPU
noop
)
mkdir -p "$OUT_DIR"
regex="a^"
for b in "${shared_bmarks[@]}"; do
if [ "$b" != "noop" ]; then
regex=`echo -n "$b|$regex"`
fi
done
"$BENCH" --benchmark_filter="$regex" --benchmark_out="$OUT_DIR/`hostname`-shared.json" --benchmark_repetitions=5;
for b in "${numa_numa_bmarks[@]}"; do
if [ "$b" != "noop" ]; then
for n1 in ${!numas}; do
for n2 in ${!numas}; do
"$BENCH" --benchmark_filter="$b/.*/$n1/$n2/" --benchmark_out="$OUT_DIR/`hostname`-$b-$n1-$n2.json" --benchmark_repetitions=5;
done
done
fi
done
for b in "${numa_gpu_bmarks[@]}"; do
if [ "$b" != "noop" ]; then
for n in ${!numas}; do
for g in ${!gpus}; do
"$BENCH" --benchmark_filter="$b.*/$n/$g/" --benchmark_out="$OUT_DIR/`hostname`-$b-$n-$g.json" --benchmark_repetitions=5;
done
done
fi
done
for b in "${gpu_gpu_bmarks[@]}"; do
if [ "$b" != "noop" ]; then
for g1 in ${!gpus}; do
for g2 in ${!gpus}; do
if [ "$g2" != "$g1" ]; then
"$BENCH" --benchmark_filter="$b.*/$g1/$g2/" --benchmark_out="$OUT_DIR/`hostname`-$b-$g1-$g2.json" --benchmark_repetitions=5;
fi
done
done
fi
done
for b in "${numa_gpu_gpu_bmarks[@]}"; do
if [ "$b" != "noop" ]; then
for n in ${!numas}; do
for g1 in ${!gpus}; do
for g2 in ${!gpus}; do
if [ "$g2" != "$g1" ]; then
"$BENCH" --benchmark_filter="$b.*/$n/$g1/$g2/" --benchmark_out="$OUT_DIR/`hostname`-$b-$n-$g1-$g2.json" --benchmark_repetitions=5;
fi
done
done
done
fi
done