3 # This test was used in a set of CMD3 tests (cmd3-5 test).
5 # Directory lookup retrieval rate single directory 10 million files
6 # 5900 random lookups/sec per client node 62,000 random lookups/sec aggregate
8 # In a dir containing 10 million non-striped files the mdsrate Test Program will
9 # perform lookups for 10 minutes. This test can be run from a single node for
10 # #1 and from all nodes for #2 aggregate test to measure lookup performance.
12 LUSTRE=${LUSTRE:-`dirname $0`/..}
13 . $LUSTRE/tests/test-framework.sh
15 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
16 assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
18 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
19 # Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
20 TESTDIR=$MOUNT/mdsrate
23 NUM_FILES=${NUM_FILES:-1000000}
24 TIME_PERIOD=${TIME_PERIOD:-600} # seconds
26 LOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
28 NODES_TO_USE=${NODES_TO_USE:-$CLIENTS}
29 NUM_CLIENTS=$(get_node_count ${NODES_TO_USE//,/ })
33 [ ! -x ${MDSRATE} ] && error "${MDSRATE} not built."
35 log "===== $0 ====== "
37 check_and_setup_lustre
41 IFree=$(inodes_available)
42 if [ $IFree -lt $NUM_FILES ]; then
46 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
48 $LFS setstripe $TESTDIR -c 1
51 if [ -n "$NOCREATE" ]; then
52 echo "NOCREATE=$NOCREATE => no file creation."
54 mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' --ignore
56 log "===== $0 Test preparation: creating ${NUM_FILES} files."
58 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir ${TESTDIR}
59 --nfiles ${NUM_FILES} --filefmt 'f%%d'"
61 mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} 2>&1
63 # No lockup if error occurs on file creation, abort.
64 [ ${PIPESTATUS[0]} != 0 ] && error "mdsrate file creation failed, aborting"
67 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --lookup --time ${TIME_PERIOD} ${SEED_OPTION}
68 --dir ${TESTDIR} --nfiles ${NUM_FILES} --filefmt 'f%%d'"
71 if [ -n "$NOSINGLE" ]; then
72 echo "NO Test for lookups on a single client."
74 log "===== $0 ### 1 NODE LOOKUPS ###"
76 mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
78 if [ ${PIPESTATUS[0]} != 0 ]; then
79 [ -f $LOG ] && sed -e "s/^/log: /" $LOG
80 error "mdsrate lookups on a single client failed, aborting"
85 [ $NUM_CLIENTS -eq 1 ] && NOMULTI=yes
86 if [ -n "$NOMULTI" ]; then
87 echo "NO test for lookups on multiple nodes."
89 log "===== $0 ### ${NUM_CLIENTS} NODES LOOKUPS ###"
91 mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
93 if [ ${PIPESTATUS[0]} != 0 ]; then
94 [ -f $LOG ] && sed -e "s/^/log: /" $LOG
95 error "mdsrate lookups on multiple nodes failed, aborting"
99 equals_msg `basename $0`: test complete, cleaning up
100 mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d'
102 check_and_cleanup_lustre