7 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
8 . $LUSTRE/tests/test-framework.sh
10 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
15 # Boulder cluster compilebench default location
16 cbench_DIR=${cbench_DIR:-/testsuite/tests/$(arch)/compilebench}
17 cbench_IDIRS=${cbench_IDIRS:-10}
18 cbench_RUNS=${cbench_RUNS:-10} # FIXME: wiki page requirements is 30, do we really need 30 ?
20 if [ "$SLOW" = "no" ]; then
28 # Boulder cluster metabench default location
29 METABENCH=${METABENCH:-/testsuite/tests/$(arch)/METABENCH/src/metabench}
30 mbench_NFILES=${mbench_NFILES:-30400}
31 [ "$SLOW" = "no" ] && mbench_NFILES=10000
32 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
34 mbench_THREADS=${mbench_THREADS:-4}
39 # Boulder cluster default location
40 SIMUL=${SIMUL:-/testsuite/tests/$(arch)/simul/simul}
42 simul_THREADS=${simul_THREADS:-2}
43 simul_REP=${simul_REP:-20}
44 [ "$SLOW" = "no" ] && simul_REP=2
49 # Boulder cluster default location
50 cnt_DIR=${cnt_DIR:-/testsuite/tests/$(arch)/connectathon}
51 cnt_NRUN=${cnt_NRUN:-10}
52 [ "$SLOW" = "no" ] && cnt_NRUN=2
57 # Boulder cluster default location
58 CASC_RW=${CASC_RW:-/testsuite/tests/$(arch)/parallel/cascading_rw}
60 casc_THREADS=${casc_THREADS:-2}
61 casc_REP=${casc_REP:-300}
62 [ "$SLOW" = "no" ] && casc_REP=10
67 # Boulder cluster default location
68 IOR=${IOR:-/testsuite/tests/$(arch)/IOR/src/C/IOR}
70 ior_THREADS=${ior_THREADS:-2}
71 ior_blockSize=${ior_blockSize:-6} # Gb
72 ior_DURATION=${ior_DURATION:-30} # minutes
73 [ "$SLOW" = "no" ] && ior_DURATION=5
76 # write_append_truncate
79 write_THREADS=${write_THREADS:-8}
80 write_REP=${write_REP:-10000}
81 [ "$SLOW" = "no" ] && write_REP=100
86 # Boulder cluster default location
87 WRITE_DISJOINT=${WRITE_DISJOINT:-/testsuite/tests/x86_64/lustre/lustre/tests/write_disjoint}
89 wdisjoint_THREADS=${wdisjoint_THREADS:-4}
90 wdisjoint_REP=${wdisjoint_REP:-10000}
91 [ "$SLOW" = "no" ] && wdisjoint_REP=100
94 check_and_setup_lustre
103 echo "${var}=${!var}"
105 [ -e $MACHINEFILE ] && cat $MACHINEFILE
109 # 5 min * cbench_RUNS
113 # compile dir kernel-1 680MB
114 # required space 680MB * cbench_IDIRS = ~7 Gb
116 test_compilebench() {
117 print_opts cbench_DIR cbench_IDIRS cbench_RUNS
119 [ -d $cbench_DIR ] || \
120 { skip "No compilebench found" && return; }
122 [ -e $cbench_DIR/compilebench ] || \
123 { skip "No compilebench build" && return; }
125 local space=$(df -P $DIR | tail -n 1 | awk '{ print $4 }')
126 if [ $space -le $((680 * 1024 * cbench_IDIRS)) ]; then
127 cbench_IDIRS=$(( space / 680 / 1024))
128 [ $cbench_IDIRS = 0 ] && \
129 skip "Need free space atleast 680 Mb, have $space" && return
131 log free space=$space, reducing initial dirs to $cbench_IDIRS
134 # t-f _base needs to be modifyed to set properly tdir
135 # for new "test_foo" functions names
136 # local testdir=$DIR/$tdir
137 local testdir=$DIR/d0.compilebench
142 local cmd="./compilebench -D $testdir -i $cbench_IDIRS -r $cbench_RUNS --makej"
151 [ $rc = 0 ] || error "compilebench failed: $rc"
154 run_test compilebench "compilebench"
157 [ -e $METABENCH ] || \
158 { skip "metabench not found" && return; }
160 local clients=$CLIENTS
161 [ -z $clients ] && clients=$(hostname)
163 num_clients=$(get_node_count ${clients//,/ })
166 # Need space estimation here.
168 generate_machine_file $clients $MACHINEFILE || \
169 error "can not generate machinefile $MACHINEFILE"
171 print_opts METABENCH clients mbench_NFILES mbench_THREADS
173 local testdir=$DIR/d0.metabench
175 # mpi_run uses mpiuser
178 # -C Run the file creation tests.
179 # -S Run the file stat tests.
180 # -c nfile Number of files to be used in each test.
181 # -k Cleanup. Remove the test directories.
182 local cmd="$METABENCH -w $testdir -c $mbench_NFILES -C -S -k"
184 mpi_run -np $((num_clients * $mbench_THREADS)) -machinefile ${MACHINEFILE} $cmd
186 if [ $rc != 0 ] ; then
187 error "metabench failed! $rc"
191 run_test metabench "metabench"
195 { skip "simul not found" && return; }
197 local clients=$CLIENTS
198 [ -z $clients ] && clients=$(hostname)
200 local num_clients=$(get_node_count ${clients//,/ })
203 # Need space estimation here.
205 generate_machine_file $clients $MACHINEFILE || \
206 error "can not generate machinefile $MACHINEFILE"
208 print_opts SIMUL clients simul_REP simul_THREADS
210 local testdir=$DIR/d0.simul
212 # mpi_run uses mpiuser
215 # -n # : repeat each test # times
216 # -N # : repeat the entire set of tests # times
218 local cmd="$SIMUL -d $testdir -n $simul_REP -N $simul_REP"
221 mpi_run -np $((num_clients * $simul_THREADS)) -machinefile ${MACHINEFILE} $cmd
224 if [ $rc != 0 ] ; then
225 error "simul failed! $rc"
229 run_test simul "simul"
231 test_connectathon() {
232 print_opts cnt_DIR cnt_NRUN
235 { skip "No connectathon dir found" && return; }
237 [ -e $cnt_DIR/runtests ] || \
238 { skip "No connectathon runtests found" && return; }
240 local testdir=$DIR/d0.connectathon
246 # -f a quick functionality test
247 # -a run basic, general, special, and lock tests
248 # -N numpasses - will be passed to the runtests script. This argument
249 # is optional. It specifies the number of times to run
252 local cmd="./runtests -N $cnt_NRUN -a -f $testdir"
261 [ $rc = 0 ] || error "connectathon failed: $rc"
264 run_test connectathon "connectathon"
268 { skip "IOR not found" && return; }
270 local clients=$CLIENTS
271 [ -z $clients ] && clients=$(hostname)
273 local num_clients=$(get_node_count ${clients//,/ })
275 local space=$(df -P $DIR | tail -n 1 | awk '{ print $4 }')
276 echo "+ $ior_blockSize * 1024 * 1024 * $num_clients * $ior_THREADS "
277 if [ $((space / 2)) -le $(( ior_blockSize * 1024 * 1024 * num_clients * ior_THREADS)) ]; then
278 echo "+ $space * 9/10 / 1024 / 1024 / $num_clients / $ior_THREADS"
279 ior_blockSize=$(( space /2 /1024 /1024 / num_clients / ior_THREADS ))
280 [ $ior_blockSize = 0 ] && \
281 skip "Need free space more than ($num_clients * $ior_THREADS )Gb: $((num_clients*ior_THREADS *1024 *1024*2)), have $space" && return
283 echo "free space=$space, Need: $num_clients x $ior_THREADS x $ior_blockSize Gb (blockSize reduced to $ior_blockSize Gb)"
286 generate_machine_file $clients $MACHINEFILE || \
287 error "can not generate machinefile $MACHINEFILE"
289 print_opts IOR ior_THREADS ior_DURATION MACHINEFILE
291 local testdir=$DIR/d0.ior
293 # mpi_run uses mpiuser
297 # -b N blockSize -- contiguous bytes to write per task (e.g.: 8, 4k, 2m, 1g)"
299 # -t N transferSize -- size of transfer in bytes (e.g.: 8, 4k, 2m, 1g)"
300 # -w writeFile -- write file"
301 # -r readFile -- read existing file"
302 # -T maxTimeDuration -- max time in minutes to run tests"
303 # -k keepFile -- keep testFile(s) on program exit
304 local cmd="$IOR -a POSIX -b ${ior_blockSize}g -o $testdir/iorData -t 2m -v -w -r -T $ior_DURATION -k"
307 mpi_run -np $((num_clients * $ior_THREADS)) -machinefile ${MACHINEFILE} $cmd
310 if [ $rc != 0 ] ; then
311 error "ior failed! $rc"
317 test_cascading_rw() {
319 { skip "cascading_rw not found" && return; }
321 local clients=$CLIENTS
322 [ -z $clients ] && clients=$(hostname)
324 num_clients=$(get_node_count ${clients//,/ })
327 # Need space estimation here.
329 generate_machine_file $clients $MACHINEFILE || \
330 error "can not generate machinefile $MACHINEFILE"
332 print_opts CASC_RW clients casc_THREADS casc_REP MACHINEFILE
334 local testdir=$DIR/d0.cascading_rw
336 # mpi_run uses mpiuser
340 # -n: repeat test # times
342 local cmd="$CASC_RW -g -d $testdir -n $casc_REP"
345 mpi_run -np $((num_clients * $casc_THREADS)) -machinefile ${MACHINEFILE} $cmd
348 if [ $rc != 0 ] ; then
349 error "cascading_rw failed! $rc"
353 run_test cascading_rw "cascading_rw"
355 test_write_append_truncate() {
356 # location is lustre/tests dir
357 if ! which write_append_truncate > /dev/null 2>&1 ; then
358 skip "write_append_truncate not found"
362 local clients=$CLIENTS
363 [ -z $clients ] && clients=$(hostname)
365 local num_clients=$(get_node_count ${clients//,/ })
368 # Need space estimation here.
370 generate_machine_file $clients $MACHINEFILE || \
371 error "can not generate machinefile $MACHINEFILE"
373 local testdir=$DIR/d0.write_append_truncate
374 local file=$testdir/f0.wat
376 print_opts clients write_REP write_THREADS MACHINEFILE
379 # mpi_run uses mpiuser
382 local cmd="write_append_truncate -n $write_REP $file"
385 mpi_run -np $((num_clients * $write_THREADS)) -machinefile ${MACHINEFILE} $cmd
388 if [ $rc != 0 ] ; then
389 error "write_append_truncate failed! $rc"
394 run_test write_append_truncate "write_append_truncate"
396 test_write_disjoint() {
397 [ -e $WRITE_DISJOINT ] || \
398 { skip "write_disjoint not found" && return; }
400 local clients=$CLIENTS
401 [ -z $clients ] && clients=$(hostname)
403 local num_clients=$(get_node_count ${clients//,/ })
406 # Need space estimation here.
408 generate_machine_file $clients $MACHINEFILE || \
409 error "can not generate machinefile $MACHINEFILE"
411 print_opts WRITE_DISJOINT clients wdisjoint_THREADS wdisjoint_REP MACHINEFILE
412 local testdir=$DIR/d0.write_disjoint
414 # mpi_run uses mpiuser
417 local cmd="$WRITE_DISJOINT -f $testdir/file -n $wdisjoint_REP"
420 mpi_run -np $((num_clients * $wdisjoint_THREADS)) -machinefile ${MACHINEFILE} $cmd
423 if [ $rc != 0 ] ; then
424 error "write_disjoint failed! $rc"
428 run_test write_disjoint "write_disjoint"
430 equals_msg `basename $0`: test complete, cleaning up
431 check_and_cleanup_lustre
432 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG || true