3 # 1st parameter: seconds per test
6 if [ "x${DURATION}" = "x" ]; then
7 echo "usage: $0 [DURATION]"
11 source ..
/utils
/tap.sh
15 plan_tests
${NUM_TESTS}
17 diag
"Executing Hash table test"
19 # TODO: missing tests:
20 # - send kill signals during tests to change the behavior between
22 # - validate that "nr_leaked" is always 0 in SUMMARY for all tests
24 TESTPROG
=.
/test_urcu_hash
27 for i
in nproc gnproc
; do
28 NUM_CPUS
=$
($i 2>/dev
/null
)
29 if [ "$?" -eq "0" ]; then
36 #thread multiplier: number of processors divided by 4.
37 if [[ ${NUM_CPUS} -lt 4 ]]; then
38 NUM_CPUS
=4 # Floor at 4 due to following assumptions.
41 THREAD_MUL
=$
((NUM_CPUS
/ 4))
45 # ** test update coherency with single-value table
47 # rw test, single key, replace and del randomly, 4 threads, auto resize.
48 # key range: init, lookup, and update: 0 to 0
49 okx
${TESTPROG} 0 $((4*THREAD_MUL)) "${DURATION}" -A -s -M 1 -N 1 -O 1 ${EXTRA_PARAMS}
51 # rw test, single key, add unique and del randomly, 4 threads, auto resize.
52 # key range: init, lookup, and update: 0 to 0
53 okx
${TESTPROG} 0 $((4*THREAD_MUL)) "${DURATION}" -A -u -M 1 -N 1 -O 1 ${EXTRA_PARAMS}
55 # rw test, single key, replace and del randomly, 2 lookup threads, 2 update threads, auto resize.
56 # key range: init, lookup, and update: 0 to 0
57 okx
${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -s -M 1 -N 1 -O 1 ${EXTRA_PARAMS}
59 # rw test, single key, add and del randomly, 2 lookup threads, 2 update threads, auto resize.
60 # key range: init, lookup, and update: 0 to 0
61 okx
${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -M 1 -N 1 -O 1 ${EXTRA_PARAMS}
64 # ** test updates vs lookups with default table
66 # rw test, 2 lookup, 2 update threads, add and del randomly, auto resize.
68 # key range: init, lookup, and update: 0 to 999999
69 okx
${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A ${EXTRA_PARAMS}
71 # rw test, 2 lookup, 2 update threads, add_replace and del randomly, auto resize.
73 # key range: init, lookup, and update: 0 to 999999
74 okx
${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -s ${EXTRA_PARAMS}
76 # rw test, 2 lookup, 2 update threads, add_unique and del randomly, auto resize.
78 # key range: init, lookup, and update: 0 to 999999
79 okx
${TESTPROG} $((2*THREAD_MUL)) $((2*THREAD_MUL)) "${DURATION}" -A -u ${EXTRA_PARAMS}
82 # test memory management backends
84 # rw test, 2 lookup, 2 update threads, add only, auto resize.
85 # max buckets: 1048576
86 # key range: init, lookup, and update: 0 to 99999999
88 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A -m 1 -n 1048576 -i \
89 -M 100000000 -N 100000000 -O 100000000 -B order
${EXTRA_PARAMS}
91 # rw test, 2 lookup, 2 update threads, add only, auto resize.
92 # max buckets: 1048576
93 # key range: init, lookup, and update: 0 to 99999999
95 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A -m 1 -n 1048576 -i \
96 -M 100000000 -N 100000000 -O 100000000 -B chunk
${EXTRA_PARAMS}
98 # rw test, 2 lookup, 2 update threads, add only, auto resize.
99 # max buckets: 1048576
100 # key range: init, lookup, and update: 0 to 99999999
102 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A -m 1 -n 1048576 -i \
103 -M 100000000 -N 100000000 -O 100000000 -B mmap
${EXTRA_PARAMS}
108 # rw test, 2 lookup, 2 update threads, add and del randomly, auto resize.
109 # max 1048576 buckets
110 # key range: init, and update: 0 to 999999
111 # key range: lookup: 1000000 to 1999999
112 # NOTE: reader threads in this test should never have a successful
114 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A \
115 -R 1000000 ${EXTRA_PARAMS}
119 # rw test, 2 lookup, 2 update threads, add and del randomly, auto resize.
120 # max 1048576 buckets
121 # key range: init, update, and lookups: 0 to 9
122 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A \
123 -M 10 -N 10 -O 10 ${EXTRA_PARAMS}
125 # rw test, 2 lookup, 2 update threads, add_unique and del randomly, auto resize.
126 # max 1048576 buckets
127 # key range: init, update, and lookups: 0 to 9
128 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A \
129 -M 10 -N 10 -O 10 -u ${EXTRA_PARAMS}
131 # rw test, 2 lookup, 2 update threads, add_replace and del randomly, auto resize.
132 # max 1048576 buckets
133 # key range: init, update, and lookups: 0 to 9
134 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A \
135 -M 10 -N 10 -O 10 -s ${EXTRA_PARAMS}
137 # ** lookup for known keys
139 # rw test, 2 lookup, 2 update threads, add_replace and del randomly, auto resize.
140 # max 1048576 buckets
141 # lookup range is entirely populated.
142 # key range: init, and lookups: 0 to 9
143 # key range: updates: 10 to 19
144 # NOTE: reader threads in this test should always have successful
146 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A \
147 -M 10 -N 10 -O 10 -R 0 -T 0 -S 10 -k 10 -s ${EXTRA_PARAMS}
151 # rw test, 2 lookup, 2 update threads, add_unique, add_replace and del randomly, auto resize.
152 # max 1048576 buckets
153 # asserts that no duplicates are observed by reader threads
154 # standard length hash chains
155 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A \
158 # rw test, 2 lookup, 2 update threads, add_unique, add_replace and del randomly, auto resize.
159 # max 1048576 buckets
160 # asserts that no duplicates are observed by reader threads
161 # create long hash chains: using modulo 4 on keys as hash
162 okx
${TESTPROG} $
((2*THREAD_MUL
)) $
((2*THREAD_MUL
)) "${DURATION}" -A \
163 -U -C 4 ${EXTRA_PARAMS}
This page took 0.032938 seconds and 4 git commands to generate.