3 # This test was used in a set of CMD3 tests (cmd3-4 test).
5 LUSTRE=${LUSTRE:-`dirname $0`/..}
6 . $LUSTRE/tests/test-framework.sh
8 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
10 assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
12 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
16 TIME_PERIOD=${TIME_PERIOD:-600} # seconds
17 SINGLE_TARGET_RATE=$((1300 / OSTCOUNT)) # ops/sec
18 AGGREGATE_TARGET_RATE=$((7000 / OSTCOUNT)) # ops/sec
20 # Local test variables
21 TESTDIR_SINGLE="${TESTDIR}/single"
22 TESTDIR_MULTI="${TESTDIR}/multi"
24 LOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
26 NODES_TO_USE=${NODES_TO_USE:-$CLIENTS}
27 NUM_CLIENTS=$(get_node_count ${NODES_TO_USE//,/ })
29 [ ! -x ${MDSRATE} ] && error "${MDSRATE} not built."
31 log "===== $0 ====== "
33 check_and_setup_lustre
35 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
37 $LFS setstripe $TESTDIR -c -1
40 # Make sure we start with a clean slate
43 if [ -n "$NOSINGLE" ]; then
44 echo "NO Test for creates for a single client."
46 log "===== $0 ### 1 NODE CREATE ###"
47 echo "Running creates on 1 node(s)."
49 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD}
50 --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'"
52 mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
54 if [ ${PIPESTATUS[0]} != 0 ]; then
55 [ -f $LOG ] && cat $LOG
56 error "mpirun ... mdsrate ... failed, aborting"
59 check_rate create ${SINGLE_TARGET_RATE} 1 ${LOG} || true
61 log "===== $0 ### 1 NODE UNLINK ###"
62 echo "Running unlinks on 1 node(s)."
64 let NUM_FILES=${SINGLE_TARGET_RATE}\*${TIME_PERIOD}
65 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink --time ${TIME_PERIOD}
66 --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'"
68 mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
70 if [ ${PIPESTATUS[0]} != 0 ]; then
71 [ -f $LOG ] && cat $LOG
72 error "mpirun ... mdsrate ... failed, aborting"
75 check_rate unlink ${SINGLE_TARGET_RATE} 1 ${LOG} || true
78 if [ -n "$NOMULTI" ]; then
79 echo "NO test for create on multiple nodes."
82 log "===== $0 ### $NUM_CLIENTS NODES CREATE ###"
83 echo "Running creates on ${NUM_CLIENTS} node(s)."
85 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD}
86 --dir ${TESTDIR_MULTI} --filefmt 'f%%d'"
88 mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
90 if [ ${PIPESTATUS[0]} != 0 ]; then
91 [ -f $LOG ] && cat $LOG
92 error "mpirun ... mdsrate ... failed, aborting"
95 check_rate create ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true
97 echo "Running unlinks on ${NUM_CLIENTS} node(s)."
99 let NUM_FILES=${AGGREGATE_TARGET_RATE}\*${TIME_PERIOD}
100 COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink --time ${TIME_PERIOD}
101 --nfiles ${NUM_FILES} --dir ${TESTDIR_MULTI} --filefmt 'f%%d'"
103 mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
105 if [ ${PIPESTATUS[0]} != 0 ]; then
106 [ -f $LOG ] && cat $LOG
107 error "mpirun ... mdsrate ... failed, aborting"
110 check_rate unlink ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true
113 equals_msg `basename $0`: test complete, cleaning up
115 zconf_umount_clients $NODES_TO_USE $MOUNT
116 check_and_cleanup_lustre