3 # This test was used in a set of CMD3 tests (cmd3-7 test).
5 # File attribute retrieval rate for small file creation
6 # 3200 ops/sec for single node 29,000 ops/sec aggregate
8 # In a dir containing 10 million non-striped files, the mdsrate Test Program
9 # will perform directory ordered stat's (readdir) for 10 minutes. This test
10 # will be run from a single node for #1 and from all nodes for #2
11 # aggregate test to measure stat performance.
13 LUSTRE=${LUSTRE:-`dirname $0`/..}
14 . $LUSTRE/tests/test-framework.sh
16 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
18 assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
20 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
24 NUM_FILES=${NUM_FILES:-1000000}
25 TIME_PERIOD=${TIME_PERIOD:-600} # seconds
26 SINGLE_TARGET_RATE=3200 # ops/sec
27 AGGREGATE_TARGET_RATE=29000 # ops/sec
29 # --random_order (default) -OR- --readdir_order
30 DIR_ORDER=${DIR_ORDER:-"--readdir_order"}
32 LOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
34 NODES_TO_USE=${NODES_TO_USE:-$CLIENTS}
35 NUM_CLIENTS=$(get_node_count ${NODES_TO_USE//,/ })
39 [ ! -x ${MDSRATE} ] && error "${MDSRATE} not built."
41 log "===== $0 ====== "
43 check_and_setup_lustre
45 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
47 $LFS setstripe $TESTDIR -i 0 -c 1
50 if [ -n "$NOCREATE" ]; then
51 echo "NOCREATE=$NOCREATE => no file creation."
53 log "===== $0 Test preparation: creating ${NUM_FILES} files."
54 echo "Test preparation: creating ${NUM_FILES} files."
56 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir ${TESTDIR}
57 --nfiles ${NUM_FILES} --filefmt 'f%%d'"
60 NUM_CLIENTS=$(get_node_count ${NODES_TO_USE//,/ })
61 NUM_THREADS=$((NUM_CLIENTS * MDSCOUNT))
62 if [ $NUM_CLIENTS -gt 50 ]; then
63 NUM_THREADS=$NUM_CLIENTS
66 mpi_run -np ${NUM_THREADS} -machinefile ${MACHINEFILE} ${COMMAND} 2>&1
67 [ ${PIPESTATUS[0]} != 0 ] && error "Error running mdsrate, aborting..."
71 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --stat --time ${TIME_PERIOD}
72 --dir ${TESTDIR} --nfiles ${NUM_FILES} --filefmt 'f%%d'
73 ${DIR_ORDER} ${SEED_OPTION}"
76 if [ -n "$NOSINGLE" ]; then
77 echo "NO Test for stats on a single client."
79 log "===== $0 ### 1 NODE STAT ###"
80 echo "Running stats on 1 node(s)."
83 mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
85 if [ ${PIPESTATUS[0]} != 0 ]; then
86 [ -f $LOG ] && cat $LOG
87 error "mpirun ... mdsrate ... failed, aborting"
89 check_rate stat ${SINGLE_TARGET_RATE} 1 ${LOG} || true
93 if [ -n "$NOMULTI" ]; then
94 echo "NO test for stats on multiple nodes."
96 log "===== $0 ### ${NUM_CLIENTS} NODES STAT ###"
97 echo "Running stats on ${NUM_CLIENTS} node(s)."
100 mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
102 if [ ${PIPESTATUS[0]} != 0 ]; then
103 [ -f $LOG ] && cat $LOG
104 error "mpirun ... mdsrate ... failed, aborting"
106 check_rate stat ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true
109 equals_msg `basename $0`: test complete, cleaning up
111 zconf_umount_clients $NODES_TO_USE $MOUNT
112 check_and_cleanup_lustre