forked from rigtorp/ipc-bench
-
Notifications
You must be signed in to change notification settings - Fork 32
/
all_lat.sh
executable file
·51 lines (46 loc) · 1.13 KB
/
all_lat.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
#!/usr/bin/env bash
SIZES="128"
COUNT=10000
LAT_TESTS="pipe_lat tcp_lat unix_lat mempipe_lat tcp_nodelay_lat"
TESTS="${LAT_TESTS}"
NUM_CORES=$2
ODIR=$1
rm -rf ${ODIR}
mkdir -p ${ODIR}
for SIZE in ${SIZES}; do
c1=0
while [[ ${c1} -lt ${NUM_CORES} ]]; do
c2=0
while [[ ${c2} -lt ${NUM_CORES} ]]; do
echo ${c1} to ${c2}
for t in ${TESTS}; do
d="${ODIR}/${SIZE}/${c1}-${c2}-${t}"
mkdir -p ${d}
if [ ${c1} -eq ${c2} ]; then
count=100
else
count=${COUNT}
fi
./${t} -t -s ${SIZE} -c ${count} -a ${c1} -b ${c2} -o ${d}
done
c2=$(expr ${c2} + 1)
done
c1=$(expr ${c1} + 1)
done
# post-processing
for t in ${TESTS}; do
ofile=${ODIR}/${t}.csv
c1=0
while [[ ${c1} -lt ${NUM_CORES} ]]; do
c2=0
while [[ ${c2} -lt ${NUM_CORES} ]]; do
d="${ODIR}/${SIZE}/${c1}-${c2}-${t}/01-${t}-headline.log"
speed=`tail -1 ${d} | awk '{print $4}' | sed -e 's/s//g'`
echo -n "${speed} " >> ${ofile}
c2=$(expr ${c2} + 1)
done
echo "" >> ${ofile}
c1=$(expr ${c1} + 1)
done
done
done