From 0106f2ac94c3d6dd8d8b6df366dd91b7db01a112 Mon Sep 17 00:00:00 2001 From: grev Date: Sat, 24 Jan 2009 09:16:51 +0000 Subject: [PATCH] b=18045 i=Adilger -- get rid of Hendrix rates values -- create NUM_FILES -le IFree -- use mdsrate for cleanup instead of rm --- lustre/tests/mdsrate-create-large.sh | 30 +++++++++++++++--------------- lustre/tests/mdsrate-create-small.sh | 25 +++++++++++++------------ lustre/tests/mdsrate-lookup-1dir.sh | 11 ++++++----- lustre/tests/mdsrate-stat-large.sh | 11 ++++++----- lustre/tests/mdsrate-stat-small.sh | 11 ++++++----- lustre/tests/test-framework.sh | 26 +++++++------------------- 6 files changed, 53 insertions(+), 61 deletions(-) diff --git a/lustre/tests/mdsrate-create-large.sh b/lustre/tests/mdsrate-create-large.sh index 00ad399..b45dae1 100644 --- a/lustre/tests/mdsrate-create-large.sh +++ b/lustre/tests/mdsrate-create-large.sh @@ -13,9 +13,9 @@ MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} TESTDIR=$MOUNT # Requirements +# set NUM_FILES=0 to force TIME_PERIOD work +NUM_FILES=${NUM_FILES:-1000000} TIME_PERIOD=${TIME_PERIOD:-600} # seconds -SINGLE_TARGET_RATE=$((1300 / OSTCOUNT)) # ops/sec -AGGREGATE_TARGET_RATE=$((7000 / OSTCOUNT)) # ops/sec # Local test variables TESTDIR_SINGLE="${TESTDIR}/single" @@ -32,6 +32,11 @@ log "===== $0 ====== " check_and_setup_lustre +IFree=$(inodes_available) +if [ $IFree -lt $NUM_FILES ]; then + NUM_FILES=$IFree +fi + generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" $LFS setstripe $TESTDIR -c -1 @@ -47,7 +52,7 @@ else echo "Running creates on 1 node(s)." COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD} - --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" + --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" echo "+ ${COMMAND}" mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG} @@ -56,14 +61,11 @@ else error "mpirun ... mdsrate ... failed, aborting" fi - check_rate create ${SINGLE_TARGET_RATE} 1 ${LOG} || true - log "===== $0 ### 1 NODE UNLINK ###" echo "Running unlinks on 1 node(s)." - let NUM_FILES=${SINGLE_TARGET_RATE}\*${TIME_PERIOD} COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink --time ${TIME_PERIOD} - --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" + --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" echo "+ ${COMMAND}" mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG} @@ -71,8 +73,11 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi +fi - check_rate unlink ${SINGLE_TARGET_RATE} 1 ${LOG} || true +IFree=$(inodes_available) +if [ $IFree -lt $NUM_FILES ]; then + NUM_FILES=$IFree fi if [ -n "$NOMULTI" ]; then @@ -83,7 +88,7 @@ else echo "Running creates on ${NUM_CLIENTS} node(s)." COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD} - --dir ${TESTDIR_MULTI} --filefmt 'f%%d'" + --nfiles $NUM_FILES --dir ${TESTDIR_MULTI} --filefmt 'f%%d'" echo "+ ${COMMAND}" mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG} @@ -92,13 +97,10 @@ else error "mpirun ... mdsrate ... failed, aborting" fi - check_rate create ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true - echo "Running unlinks on ${NUM_CLIENTS} node(s)." - let NUM_FILES=${AGGREGATE_TARGET_RATE}\*${TIME_PERIOD} COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink --time ${TIME_PERIOD} - --nfiles ${NUM_FILES} --dir ${TESTDIR_MULTI} --filefmt 'f%%d'" + --nfiles ${NUM_FILES} --dir ${TESTDIR_MULTI} --filefmt 'f%%d'" echo "+ ${COMMAND}" mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG} @@ -107,12 +109,10 @@ else error "mpirun ... mdsrate ... failed, aborting" fi - check_rate unlink ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true fi equals_msg `basename $0`: test complete, cleaning up rm -f $MACHINEFILE -zconf_umount_clients $NODES_TO_USE $MOUNT check_and_cleanup_lustre #rm -f $LOG diff --git a/lustre/tests/mdsrate-create-small.sh b/lustre/tests/mdsrate-create-small.sh index 0f42e5d..5455796 100644 --- a/lustre/tests/mdsrate-create-small.sh +++ b/lustre/tests/mdsrate-create-small.sh @@ -13,10 +13,8 @@ MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines} TESTDIR=$MOUNT # Requirements -# The default number of stripes per file is set to 1 in test3/run_test.sh. +NUM_FILES=${NUM_FILES:-1000000} TIME_PERIOD=${TIME_PERIOD:-600} # seconds -SINGLE_TARGET_RATE=1400 # ops/sec -AGGREGATE_TARGET_RATE=10000 # ops/sec # Local test variables TESTDIR_SINGLE="${TESTDIR}/single" @@ -42,6 +40,11 @@ log "===== $0 ====== " check_and_setup_lustre +IFree=$(inodes_available) +if [ $IFree -lt $NUM_FILES ]; then + NUM_FILES=$IFree +fi + generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" $LFS setstripe $TESTDIR -i 0 -c 1 @@ -59,7 +62,7 @@ else echo "Running creates on 1 node(s)." COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD} - --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" + --nfiles $NUM_FILES --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" echo "+ ${COMMAND}" mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG} @@ -67,7 +70,6 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate create ${SINGLE_TARGET_RATE} 1 ${LOG} || true fi if [ -n "$NOUNLINK" ]; then @@ -76,7 +78,6 @@ else log "===== $0 ### 1 NODE UNLINK ###" echo "Running unlinks on 1 node(s)." - let NUM_FILES=${SINGLE_TARGET_RATE}\*${TIME_PERIOD} COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink --time ${TIME_PERIOD} --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" echo "+ ${COMMAND}" @@ -86,10 +87,14 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate unlink ${SINGLE_TARGET_RATE} 1 ${LOG} || true fi fi +IFree=$(inodes_available) +if [ $IFree -lt $NUM_FILES ]; then + NUM_FILES=$IFree +fi + if [ -n "$NOMULTI" ]; then echo "NO tests on multiple nodes." else @@ -102,7 +107,7 @@ else echo "Running creates on ${NUM_CLIENTS} node(s) with $THREADS_PER_CLIENT threads per client." COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD} - --dir ${TESTDIR_MULTI} --filefmt 'f%%d'" + --nfiles $NUM_FILES --dir ${TESTDIR_MULTI} --filefmt 'f%%d'" echo "+ ${COMMAND}" mpi_run -np $((NUM_CLIENTS * THREADS_PER_CLIENT)) -machinefile ${MACHINEFILE} \ ${COMMAND} | tee ${LOG} @@ -110,7 +115,6 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate create ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true fi if [ -n "$NOUNLINK" ]; then @@ -119,7 +123,6 @@ else log "===== $0 ### $NUM_CLIENTS NODES UNLINK ###" echo "Running unlinks on ${NUM_CLIENTS} node(s) with $THREADS_PER_CLIENT threads per client." - let NUM_FILES=${AGGREGATE_TARGET_RATE}\*${TIME_PERIOD} COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink --time ${TIME_PERIOD} --nfiles ${NUM_FILES} --dir ${TESTDIR_MULTI} --filefmt 'f%%d'" echo "+ ${COMMAND}" @@ -129,13 +132,11 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate unlink ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true fi fi equals_msg `basename $0`: test complete, cleaning up rm -f $MACHINEFILE -zconf_umount_clients $NODES_TO_USE $MOUNT check_and_cleanup_lustre #rm -f $LOG diff --git a/lustre/tests/mdsrate-lookup-1dir.sh b/lustre/tests/mdsrate-lookup-1dir.sh index 9c46674..d529bc6 100644 --- a/lustre/tests/mdsrate-lookup-1dir.sh +++ b/lustre/tests/mdsrate-lookup-1dir.sh @@ -21,8 +21,6 @@ TESTDIR=$MOUNT # Requirements NUM_FILES=${NUM_FILES:-1000000} TIME_PERIOD=${TIME_PERIOD:-600} # seconds -SINGLE_TARGET_RATE=5900 # ops/sec -AGGREGATE_TARGET_RATE=62000 # ops/sec LOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log} CLIENT=$SINGLECLIENT @@ -37,6 +35,11 @@ log "===== $0 ====== " check_and_setup_lustre +IFree=$(inodes_available) +if [ $IFree -lt $NUM_FILES ]; then + NUM_FILES=$IFree +fi + generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" $LFS setstripe $TESTDIR -c 1 @@ -79,7 +82,6 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate lookup ${SINGLE_TARGET_RATE} 1 ${LOG} || true fi # 2 @@ -95,12 +97,11 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate lookup ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true fi equals_msg `basename $0`: test complete, cleaning up +mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rm -f $MACHINEFILE -zconf_umount_clients $NODES_TO_USE $MOUNT check_and_cleanup_lustre #rm -f $LOG diff --git a/lustre/tests/mdsrate-stat-large.sh b/lustre/tests/mdsrate-stat-large.sh index 3620282..63d41ab 100644 --- a/lustre/tests/mdsrate-stat-large.sh +++ b/lustre/tests/mdsrate-stat-large.sh @@ -23,8 +23,6 @@ TESTDIR=$MOUNT # Requirements NUM_FILES=${NUM_FILES:-1000000} TIME_PERIOD=${TIME_PERIOD:-600} # seconds -SINGLE_TARGET_RATE=$((3300 / OSTCOUNT)) # ops/sec -AGGREGATE_TARGET_RATE=$((28500 / OSTCOUNT)) # ops/sec # --random_order (default) -OR- --readdir_order DIR_ORDER=${DIR_ORDER:-"--readdir_order"} @@ -42,6 +40,11 @@ log "===== $0 ====== " check_and_setup_lustre +IFree=$(inodes_available) +if [ $IFree -lt $NUM_FILES ]; then + NUM_FILES=$IFree +fi + generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" $LFS setstripe $TESTDIR -c -1 @@ -87,7 +90,6 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate stat ${SINGLE_TARGET_RATE} 1 ${LOG} || true fi # 2 @@ -105,12 +107,11 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate stat ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true fi equals_msg `basename $0`: test complete, cleaning up +mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rm -f $MACHINEFILE -zconf_umount_clients $NODES_TO_USE $MOUNT check_and_cleanup_lustre #rm -f $LOG diff --git a/lustre/tests/mdsrate-stat-small.sh b/lustre/tests/mdsrate-stat-small.sh index ddcd609..2601d7c 100644 --- a/lustre/tests/mdsrate-stat-small.sh +++ b/lustre/tests/mdsrate-stat-small.sh @@ -23,8 +23,6 @@ TESTDIR=$MOUNT # Requirements NUM_FILES=${NUM_FILES:-1000000} TIME_PERIOD=${TIME_PERIOD:-600} # seconds -SINGLE_TARGET_RATE=3200 # ops/sec -AGGREGATE_TARGET_RATE=29000 # ops/sec # --random_order (default) -OR- --readdir_order DIR_ORDER=${DIR_ORDER:-"--readdir_order"} @@ -42,6 +40,11 @@ log "===== $0 ====== " check_and_setup_lustre +IFree=$(inodes_available) +if [ $IFree -lt $NUM_FILES ]; then + NUM_FILES=$IFree +fi + generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" $LFS setstripe $TESTDIR -i 0 -c 1 @@ -87,7 +90,6 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate stat ${SINGLE_TARGET_RATE} 1 ${LOG} || true fi # 2 @@ -104,12 +106,11 @@ else [ -f $LOG ] && cat $LOG error "mpirun ... mdsrate ... failed, aborting" fi - check_rate stat ${AGGREGATE_TARGET_RATE} ${NUM_CLIENTS} ${LOG} || true fi equals_msg `basename $0`: test complete, cleaning up +mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rm -f $MACHINEFILE -zconf_umount_clients $NODES_TO_USE $MOUNT check_and_cleanup_lustre #rm -f $LOG diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index dda588a..ac2a588 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1953,25 +1953,9 @@ multiop_bg_pause() { return 0 } -check_rate() { - local OP=$1 - local TARGET_RATE=$2 - local NUM_CLIENTS=$3 - local LOG=$4 - - local RATE=$(awk '/^Rate: [0-9\.]+ '"${OP}"'s\/sec/ { print $2}' ${LOG}) - - # We need to use bc since the rate is a floating point number - local RES=$(echo "${RATE} < ${TARGET_RATE}" | bc -l ) - if [ "${RES}" = 0 ]; then - echo "Success: ${RATE} ${OP}s/sec met target rate" \ - "${TARGET_RATE} ${OP}s/sec for ${NUM_CLIENTS} client(s)." - return 0 - else - echo "Failure: ${RATE} ${OP}s/sec did not meet target rate" \ - "${TARGET_RATE} ${OP}s/sec for ${NUM_CLIENTS} client(s)." - return 1 - fi +inodes_available () { + local IFree=$($LFS df -i $MOUNT | grep ^$FSNAME | awk '{print $4}' | sort -un | head -1) || return 1 + echo $IFree } # reset llite stat counters @@ -2053,6 +2037,10 @@ mpi_run () { eval $command } +mdsrate_cleanup () { + mpi_run -np $1 -machinefile $2 ${MDSRATE} --unlink --nfiles $3 --dir $4 --filefmt $5 +} + delayed_recovery_enabled () { do_facet mds "lctl get_param -n mds.${mds_svc}.stale_export_age" > /dev/null 2>&1 } -- 1.8.3.1