if [ -n "$NOSINGLE" ]; then
echo "NO Test for creates for a single client."
else
+ # We can use np = $NUM_CLIENTS to speed up the cleanup
+ mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_SINGLE 'f%%d' --ignore
+
log "===== $0 ### 1 NODE CREATE ###"
echo "Running creates on 1 node(s)."
if [ -n "$NOMULTI" ]; then
echo "NO test for create on multiple nodes."
else
+ mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_MULTI 'f%%d' --ignore
log "===== $0 ### $NUM_CLIENTS NODES CREATE ###"
echo "Running creates on ${NUM_CLIENTS} node(s)."
fi
equals_msg `basename $0`: test complete, cleaning up
+mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_SINGLE 'f%%d' --ignore
+mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_MULTI 'f%%d' --ignore
rm -f $MACHINEFILE
check_and_cleanup_lustre
#rm -f $LOG
if [ -n "$NOCREATE" ]; then
echo "NO Test for creates for a single client."
else
- do_node ${CLIENT} "rm -rf $TESTDIR_SINGLE"
+ # We can use np = $NUM_CLIENTS to speed up the cleanup
+ mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_SINGLE 'f%%d' --ignore
log "===== $0 ### 1 NODE CREATE ###"
echo "Running creates on 1 node(s)."
if [ -n "$NOCREATE" ]; then
echo "NO test for create on multiple nodes."
else
- do_node $CLIENT rm -rf $TESTDIR_MULTI
+ mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_MULTI 'f%%d' --ignore
log "===== $0 ### $NUM_CLIENTS NODES CREATE ###"
echo "Running creates on ${NUM_CLIENTS} node(s) with $THREADS_PER_CLIENT threads per client."
fi
equals_msg `basename $0`: test complete, cleaning up
+mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_SINGLE 'f%%d' --ignore
+mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR_MULTI 'f%%d' --ignore
rm -f $MACHINEFILE
check_and_cleanup_lustre
#rm -f $LOG
assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
-TESTDIR=$MOUNT
+# Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
+TESTDIR=$MOUNT/mdsrate
# Requirements
NUM_FILES=${NUM_FILES:-1000000}
log "===== $0 ====== "
check_and_setup_lustre
+mkdir -p $TESTDIR
+chmod 0777 $TESTDIR
IFree=$(inodes_available)
if [ $IFree -lt $NUM_FILES ]; then
if [ -n "$NOCREATE" ]; then
echo "NOCREATE=$NOCREATE => no file creation."
else
+ mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' --ignore
+
log "===== $0 Test preparation: creating ${NUM_FILES} files."
echo "Test preparation: creating ${NUM_FILES} files."
assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
-TESTDIR=$MOUNT
+# Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
+TESTDIR=$MOUNT/mdsrate
# Requirements
NUM_FILES=${NUM_FILES:-1000000}
log "===== $0 ====== "
check_and_setup_lustre
+mkdir -p $TESTDIR
+chmod 0777 $TESTDIR
IFree=$(inodes_available)
if [ $IFree -lt $NUM_FILES ]; then
if [ -n "$NOCREATE" ]; then
echo "NOCREATE=$NOCREATE => no file creation."
else
+ mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' --ignore
+
log "===== $0 Test preparation: creating ${NUM_FILES} files."
echo "Test preparation: creating ${NUM_FILES} files."
assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
-TESTDIR=$MOUNT
+# Do not use name [df][0-9]* to avoid cleanup by rm, bug 18045
+TESTDIR=$MOUNT/mdsrate
# Requirements
NUM_FILES=${NUM_FILES:-1000000}
log "===== $0 ====== "
check_and_setup_lustre
+mkdir -p $TESTDIR
+chmod 0777 $TESTDIR
IFree=$(inodes_available)
if [ $IFree -lt $NUM_FILES ]; then
if [ -n "$NOCREATE" ]; then
echo "NOCREATE=$NOCREATE => no file creation."
else
+ mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' --ignore
+
log "===== $0 Test preparation: creating ${NUM_FILES} files."
echo "Test preparation: creating ${NUM_FILES} files."
RANDOM = 'A',
READDIR = 'B',
RECREATE = 'C',
+ IGNORE = 'E',
VERBOSE = 'V',
DEBUG = 'v',
HELP = 'h',
{"random_order", 0, NULL, RANDOM },
{"readdir_order", 0, NULL, READDIR },
{"recreate", 0, NULL, RECREATE },
+ {"ignore", 0, NULL, IGNORE },
{"verbose", 0, NULL, VERBOSE },
{"debug", 0, NULL, DEBUG },
{"help", 0, NULL, HELP },
int order = RANDOM;
int seed;
int recreate;
+int ignore;
int verbose;
int debug;
struct stat statbuf;
char *usage_msg = "usage: %s\n"
" { --create [ --noexcl ] | --lookup | --mknod |\n"
- " --open | --stat | --unlink [ --recreate ] }\n"
+ " --open | --stat | --unlink [ --recreate ] [ --ignore ] }\n"
" [ --help ] [ --verbose ] [ --debug ]\n"
" { [ --begin <num> ] --nfiles <num> }\n"
" [ --iters <num> ] [ --time <secs> ]\n"
}
order = c;
break;
+ case IGNORE:
+ ++ignore;
+ break;
case DEBUG:
++debug;
case VERBOSE:
/* if we're not measuring creation rates then precreate
* the files we're operating on. */
- if ((mode != CREATE) && (mode != MKNOD)) {
+ if ((mode != CREATE) && (mode != MKNOD) && !ignore) {
/* create the files in reverse order. When we encounter
* a file that already exists, assume the remainder of
* the files exist to save time. The timed performance
if (rc) {
if (((rc = errno) == EINTR) && alarm_caught)
break;
+ if (((rc = errno) == ENOENT) && ignore)
+ continue;
fatal(myrank, "unlink(%s) error: %s\n",
filename, strerror(rc));
}
}
mdsrate_cleanup () {
- mpi_run -np $1 -machinefile $2 ${MDSRATE} --unlink --nfiles $3 --dir $4 --filefmt $5
+ mpi_run -np $1 -machinefile $2 ${MDSRATE} --unlink --nfiles $3 --dir $4 --filefmt $5 $6
}