Whamcloud - gitweb
branch: HEAD
authorericm <ericm>
Thu, 8 Oct 2009 21:00:29 +0000 (21:00 +0000)
committerericm <ericm>
Thu, 8 Oct 2009 21:00:29 +0000 (21:00 +0000)
speed up mdsrate test.
b=20501
r=rread
r=grev

lustre/tests/mdsrate-create-large.sh
lustre/tests/mdsrate-create-small.sh
lustre/tests/mdsrate-lookup-10dirs.sh
lustre/tests/mdsrate-lookup-1dir.sh
lustre/tests/mdsrate-stat-large.sh
lustre/tests/mdsrate-stat-small.sh
lustre/tests/test-framework.sh

index 5201349..17e290e 100644 (file)
@@ -10,7 +10,7 @@ init_test_env $@
 assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
 
 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
-TESTDIR=$MOUNT
+BASEDIR=$MOUNT/mdsrate
 
 # Requirements
 # set NUM_FILES=0 to force TIME_PERIOD work  
@@ -18,8 +18,8 @@ NUM_FILES=${NUM_FILES:-1000000}
 TIME_PERIOD=${TIME_PERIOD:-600}                        # seconds
 
 # Local test variables
-TESTDIR_SINGLE="${TESTDIR}/single"
-TESTDIR_MULTI="${TESTDIR}/multi"
+TESTDIR_SINGLE="${BASEDIR}/single"
+TESTDIR_MULTI="${BASEDIR}/multi"
 
 LOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
 CLIENT=$SINGLECLIENT
@@ -32,6 +32,11 @@ log "===== $0 ====== "
 
 check_and_setup_lustre
 
+mkdir -p $BASEDIR
+chmod 0777 $BASEDIR
+$LFS setstripe $BASEDIR -c -1
+get_stripe $BASEDIR
+
 IFree=$(inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
@@ -39,9 +44,6 @@ fi
 
 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
 
-$LFS setstripe $TESTDIR -c -1
-get_stripe $TESTDIR
-
 # Make sure we start with a clean slate
 rm -f ${LOG}
 
@@ -79,6 +81,8 @@ else
        [ -f $LOG ] && sed -e "s/^/log: /" $LOG
        error "mdsrate unlink on a single client failed, aborting"
     fi
+
+    rmdir $TESTDIR_SINGLE
 fi
 
 IFree=$(inodes_available)
@@ -120,8 +124,11 @@ else
        [ -f $LOG ] && sed -e "s/^/log: /" $LOG
        error "mdsrate unlink on multiple nodes failed, aborting"
     fi
+
+    rmdir $TESTDIR_MULTI
 fi
 
+rmdir $BASEDIR || true
 rm -f $MACHINEFILE
 check_and_cleanup_lustre
 #rm -f $LOG
index b5db20f..c7ca1c7 100644 (file)
@@ -10,15 +10,15 @@ init_test_env $@
 assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
 
 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
-TESTDIR=$MOUNT
+BASEDIR=$MOUNT/mdsrate
 
 # Requirements
 NUM_FILES=${NUM_FILES:-1000000}
 TIME_PERIOD=${TIME_PERIOD:-600}                        # seconds
 
 # Local test variables
-TESTDIR_SINGLE="${TESTDIR}/single"
-TESTDIR_MULTI="${TESTDIR}/multi"
+TESTDIR_SINGLE="${BASEDIR}/single"
+TESTDIR_MULTI="${BASEDIR}/multi"
 
 LOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
 CLIENT=$SINGLECLIENT
@@ -40,6 +40,11 @@ log "===== $0 ====== "
 
 check_and_setup_lustre
 
+mkdir -p $BASEDIR
+chmod 0777 $BASEDIR
+$LFS setstripe $BASEDIR -i 0 -c 1
+get_stripe $BASEDIR
+
 IFree=$(inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
     NUM_FILES=$IFree
@@ -47,9 +52,6 @@ fi
   
 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
 
-$LFS setstripe $TESTDIR -i 0 -c 1
-get_stripe $TESTDIR
-
 if [ -n "$NOSINGLE" ]; then
     echo "NO Tests on single client."
 else
@@ -91,6 +93,8 @@ else
             [ -f $LOG ] && sed -e "s/^/log: /" $LOG
             error "mdsrate unlinks for a single client failed, aborting"
         fi
+
+        rmdir $TESTDIR_SINGLE
     fi
 fi
 
@@ -139,10 +143,13 @@ else
             [ -f $LOG ] && sed -e "s/^/log: /" $LOG
             error "mdsrate unlinks multiple nodes failed, aborting"
         fi
+
+        rmdir $TESTDIR_MULTI
     fi
 fi
 
 equals_msg `basename $0`: test complete, cleaning up
+rmdir $BASEDIR || true
 rm -f $MACHINEFILE 
 check_and_cleanup_lustre
 #rm -f $LOG
index b139a64..d99c01b 100644 (file)
@@ -18,7 +18,7 @@ assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
 
 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
 # Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
-TESTDIR=$MOUNT/mdsrate
+BASEDIR=$MOUNT/mdsrate
 
 # Requirements
 NUM_DIRS=${NUM_DIRS:-10}
@@ -37,8 +37,11 @@ rm -f $LOG
 log "===== $0 ====== " 
 
 check_and_setup_lustre
-mkdir -p $TESTDIR
-chmod 0777 $TESTDIR
+
+mkdir -p $BASEDIR
+chmod 0777 $BASEDIR
+$LFS setstripe $BASEDIR -c 1
+get_stripe $BASEDIR
 
 IFree=$(inodes_available)
 if [ $IFree -lt $((NUM_FILES * NUM_DIRS)) ]; then
@@ -47,17 +50,14 @@ fi
 
 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
 
-$LFS setstripe $TESTDIR -c 1
-get_stripe $TESTDIR
-
-DIRfmt="${TESTDIR}/t6-%d"
+DIRfmt="${BASEDIR}/lookup-%d"
 
 if [ -n "$NOCREATE" ]; then
     echo "NOCREATE=$NOCREATE  => no file creation."
 else
     # FIXME: does it make sense to add the possibility to unlink dirfmt to mdsrate?
     for i in $(seq 0 $NUM_DIRS); do
-        mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR/t6-$i 'f%%d' --ignore
+        mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $BASEDIR/lookup-$i 'f%%d' --ignore
     done
 
     log "===== $0 Test preparation: creating ${NUM_DIRS} dirs with ${NUM_FILES} files."
@@ -112,11 +112,10 @@ fi
 equals_msg `basename $0`: test complete, cleaning up
 # FIXME: does it make sense to add the possibility to unlink dirfmt to mdsrate?
 for i in $(seq 0 $NUM_DIRS); do
-    mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR/t6-$i 'f%%d' --ignore
-    rmdir $TESTDIR/t6-$i
+    mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $BASEDIR/lookup-$i 'f%%d' --ignore
 done
 
-rmdir $TESTDIR || true
+rmdir $BASEDIR || true
 rm -f $MACHINEFILE
 check_and_cleanup_lustre
 #rm -f $LOG
index c1cba66..291fd70 100644 (file)
@@ -17,7 +17,8 @@ assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
 
 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
 # Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
-TESTDIR=$MOUNT/mdsrate
+BASEDIR=$MOUNT/mdsrate
+TESTDIR=$BASEDIR/lookup
 
 # Requirements
 NUM_FILES=${NUM_FILES:-1000000}
@@ -35,8 +36,11 @@ rm -f $LOG
 log "===== $0 ====== " 
 
 check_and_setup_lustre
-mkdir -p $TESTDIR
-chmod 0777 $TESTDIR
+
+mkdir -p $BASEDIR
+chmod 0777 $BASEDIR
+$LFS setstripe $BASEDIR -c 1
+get_stripe $BASEDIR
 
 IFree=$(inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
@@ -45,9 +49,6 @@ fi
 
 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
 
-$LFS setstripe $TESTDIR -c 1
-get_stripe $TESTDIR
-
 if [ -n "$NOCREATE" ]; then
     echo "NOCREATE=$NOCREATE  => no file creation."
 else
@@ -103,6 +104,7 @@ fi
 
 equals_msg `basename $0`: test complete, cleaning up
 mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d'
+rmdir $BASEDIR || true
 rm -f $MACHINEFILE
 check_and_cleanup_lustre
 #rm -f $LOG
index ecb18e4..fef4381 100644 (file)
@@ -19,7 +19,8 @@ assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
 
 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
 # Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
-TESTDIR=$MOUNT/mdsrate
+BASEDIR=$MOUNT/mdsrate
+TESTDIR=$MOUNT/stat
 
 # Requirements
 NUM_FILES=${NUM_FILES:-1000000}
@@ -40,8 +41,11 @@ rm -f $LOG
 log "===== $0 ====== " 
 
 check_and_setup_lustre
-mkdir -p $TESTDIR
-chmod 0777 $TESTDIR
+
+mkdir -p $BASEDIR
+chmod 0777 $BASEDIR
+$LFS setstripe $BASEDIR -c -1
+get_stripe $BASEDIR
 
 IFree=$(inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
@@ -50,9 +54,6 @@ fi
 
 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
 
-$LFS setstripe $TESTDIR -c -1
-get_stripe $TESTDIR
-
 if [ -n "$NOCREATE" ]; then
     echo "NOCREATE=$NOCREATE  => no file creation."
 else
@@ -112,6 +113,7 @@ fi
 
 equals_msg `basename $0`: test complete, cleaning up
 mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d'
+rmdir $BASEDIR || true
 rm -f $MACHINEFILE
 check_and_cleanup_lustre
 #rm -f $LOG
index 9ae440a..6de066a 100644 (file)
@@ -19,7 +19,8 @@ assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
 
 MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
 # Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
-TESTDIR=$MOUNT/mdsrate
+BASEDIR=$MOUNT/mdsrate
+TESTDIR=$BASEDIR/stat
 
 # Requirements
 NUM_FILES=${NUM_FILES:-1000000}
@@ -40,8 +41,11 @@ rm -f $LOG
 log "===== $0 ====== " 
 
 check_and_setup_lustre
-mkdir -p $TESTDIR
-chmod 0777 $TESTDIR
+
+mkdir -p $BASEDIR
+chmod 0777 $BASEDIR
+$LFS setstripe $BASEDIR -i 0 -c 1
+get_stripe $BASEDIR
 
 IFree=$(inodes_available)
 if [ $IFree -lt $NUM_FILES ]; then
@@ -50,9 +54,6 @@ fi
 
 generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
 
-$LFS setstripe $TESTDIR -i 0 -c 1
-get_stripe $TESTDIR
-
 if [ -n "$NOCREATE" ]; then
     echo "NOCREATE=$NOCREATE  => no file creation."
 else
@@ -112,6 +113,7 @@ fi
 
 equals_msg `basename $0`: test complete, cleaning up
 mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d'
+rmdir $BASEDIR || true
 rm -f $MACHINEFILE
 check_and_cleanup_lustre
 #rm -f $LOG
index beb9b40..be4ae46 100644 (file)
@@ -2891,7 +2891,10 @@ get_mds_dir () {
 }
 
 mdsrate_cleanup () {
-    mpi_run -np $1 -machinefile $2 ${MDSRATE} --unlink --nfiles $3 --dir $4 --filefmt $5 $6
+    if [ -d $4 ]; then
+        mpi_run -np $1 -machinefile $2 ${MDSRATE} --unlink --nfiles $3 --dir $4 --filefmt $5 $6
+        rmdir $4
+    fi
 }
 
 delayed_recovery_enabled () {