7a0974207c75b42a0a45cb800e6271f8df899b3f
[urcu.git] / tests / benchmark / run-urcu-tests.sh
1 #!/bin/bash
2
3 source ../utils/tap.sh
4
5 NUM_TESTS=103
6
7 plan_tests ${NUM_TESTS}
8
9 #run all tests
10 diag "Executing URCU tests"
11
12 NUM_CPUS="1"
13 for i in nproc gnproc; do
14 NUM_CPUS=$($i 2>/dev/null)
15 if [ "$?" -eq "0" ]; then
16 break
17 else
18 NUM_CPUS="1"
19 fi
20 done
21
22 #set to number of active CPUS
23 if [[ ${NUM_CPUS} -lt 4 ]]; then
24 NUM_CPUS=4 # Floor at 4 due to following assumptions.
25 fi
26
27 #first parameter: seconds per test
28 DURATION=$1
29
30 #extra options, e.g. for setting affinity on even CPUs :
31 #EXTRA_OPTS=$(for a in $(seq 0 2 127); do echo -n "-a ${a} "; done)
32
33 #ppc64 striding, use with NUM_CPUS=8
34
35 #stride 1
36 #EXTRA_OPTS=$(for a in $(seq 0 2 15); do echo -n "-a ${a} "; done)
37 #stride 2
38 #EXTRA_OPTS=$(for a in $(seq 0 4 31); do echo -n "-a ${a} "; done)
39 #stride 4
40 #EXTRA_OPTS=$(for a in $(seq 0 8 63); do echo -n "-a ${a} "; done)
41 #stride 8
42 #EXTRA_OPTS=$(for a in $(seq 0 16 127); do echo -n "-a ${a} "; done)
43
44 #Vary update fraction
45 #x: vary update fraction from 0 to 0.0001
46 #fix number of readers and reader C.S. length, vary delay between updates
47 #y: ops/s
48
49
50 diag "Executing batch RCU test"
51
52 BATCH_ARRAY="1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536
53 131072 262144"
54 NR_WRITERS=$((${NUM_CPUS} / 2))
55
56 NR_READERS=$((${NUM_CPUS} - ${NR_WRITERS}))
57 for BATCH_SIZE in ${BATCH_ARRAY}; do
58 okx ./runtests-batch.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} -d 0 -b ${BATCH_SIZE} ${EXTRA_OPTS}
59 done
60
61 #setting gc each 32768. ** UPDATE FOR YOUR ARCHITECTURE BASED ON TEST ABOVE **
62 EXTRA_OPTS="${EXTRA_OPTS} -b 32768"
63
64 diag "Executing update fraction test"
65
66 WDELAY_ARRAY="0 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
67 65536 131072 262144 524288 1048576 2097152 4194304 8388608
68 16777216 33554432 67108864 134217728"
69 NR_WRITERS=$((${NUM_CPUS} / 2))
70
71 NR_READERS=$((${NUM_CPUS} - ${NR_WRITERS}))
72 for WDELAY in ${WDELAY_ARRAY}; do
73 okx ./runtests.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} -d ${WDELAY} ${EXTRA_OPTS}
74 done
75
76 #Test scalability :
77 # x: vary number of readers from 0 to num cpus
78 # y: ops/s
79 # 0 writer.
80
81 diag "Executing scalability test"
82
83 NR_WRITERS=0
84
85 for NR_READERS in $(seq 1 ${NUM_CPUS}); do
86 okx ./runtests.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} ${EXTRA_OPTS}
87 done
88
89
90 # x: Vary reader C.S. length from 0 to 100 us
91 # y: ops/s
92 # 8 readers
93 # 0 writers
94
95 diag "Executing reader C.S. length test"
96
97 NR_READERS=${NUM_CPUS}
98 NR_WRITERS=0
99 #in loops.
100 READERCSLEN_ARRAY="0 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152"
101
102 for READERCSLEN in ${READERCSLEN_ARRAY}; do
103 okx ./runtests.sh ${NR_READERS} ${NR_WRITERS} ${DURATION} ${EXTRA_OPTS} -c ${READERCSLEN}
104 done
This page took 0.050299 seconds and 3 git commands to generate.