From c83304607a2a76b65d7dc2444f41d3b75d92699e Mon Sep 17 00:00:00 2001 From: Elena Gryaznova Date: Thu, 14 Oct 2021 19:18:31 +0300 Subject: [PATCH] LU-12391 tests: mdsrate tests improvements Patch improves mdsrate tests to work with striped directories which are created if MDSRATE_ENABLE_DNE=true. mdsrate.c is fixed to not fail if --mdtcount option is used and ndirs=1. Without this fix mdsrate --mdcount fails as: cannot create stripe dir: File exists when the ranks do system(mkdir_cmd) on the directory which was already created by the first executed rank. Patch sets mdt.*.enable_remote_dir_gid to "-1" to allow mpiuser to create remote directories. Patch makes the mdsrate based tests a bit more verbose: mdsrate create/mknod is called with --debug option if VERBOSE set to "true". Test-Parameters: trivial testlist=performance-sanity Fixes: f31c60c97328 ("LU-1187 tests: Add mntfmt/mntcount/mdtcount to mdsrate") Signed-off-by: Elena Gryaznova HPE-bug-id: LUS-7262 Reviewed-by: Vladimir Saveliev Reviewed-by: Alexander Boyko Change-Id: Ieb32ad7dfad838fc9124740236889a5fe47cb901 Reviewed-on: https://review.whamcloud.com/35069 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/mdsrate-create-large.sh | 25 ++++++++++++++++++++++--- lustre/tests/mdsrate-create-small.sh | 25 ++++++++++++++++++++++--- lustre/tests/mdsrate-lookup-10dirs.sh | 30 +++++++++++++++++++++++++----- lustre/tests/mdsrate-lookup-1dir.sh | 28 ++++++++++++++++++++++++---- lustre/tests/mdsrate-stat-large.sh | 29 ++++++++++++++++++++++++----- lustre/tests/mdsrate-stat-small.sh | 30 +++++++++++++++++++++++++----- lustre/tests/mpi/mdsrate.c | 22 +++++++++++++++++----- 7 files changed, 159 insertions(+), 30 deletions(-) diff --git a/lustre/tests/mdsrate-create-large.sh b/lustre/tests/mdsrate-create-large.sh index 23fbfe5..5eadc47 100644 --- a/lustre/tests/mdsrate-create-large.sh +++ b/lustre/tests/mdsrate-create-large.sh @@ -30,7 +30,16 @@ log "===== $0 ====== " check_and_setup_lustre -mkdir -p $BASEDIR +MDSRATE_ENABLE_DNE=${MDSRATE_ENABLE_DNE:-false} +if $MDSRATE_ENABLE_DNE; then + test_mkdir $BASEDIR + mdtcount_opt="--mdtcount $MDSCOUNT" +else + mkdir $BASEDIR +fi +if $VERBOSE; then + debug_opt="--debug" +fi chmod 0777 $BASEDIR mdsrate_STRIPEPARAMS=${mdsrate_STRIPEPARAMS:-${fs_STRIPEPARAMS:-"-c -1"}} setstripe_getstripe $BASEDIR $mdsrate_STRIPEPARAMS @@ -40,7 +49,13 @@ if [ $IFree -lt $NUM_FILES ]; then NUM_FILES=$IFree fi -generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" +generate_machine_file $NODES_TO_USE $MACHINEFILE || + error "can not generate machinefile" + +p="$TMP/$TESTSUITE-$TESTNAME.parameters" +save_lustre_params $(get_facets MDS) mdt.*.enable_remote_dir_gid > $p +do_nodes $(comma_list $(mdts_nodes)) \ + $LCTL set_param mdt.*.enable_remote_dir_gid=-1 # Make sure we start with a clean slate rm -f ${LOG} @@ -54,7 +69,8 @@ else log "===== $0 ### 1 NODE CREATE ###" COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD} - --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" + --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d' + $mdtcount_opt $debug_opt" echo "+ ${COMMAND}" mpi_run ${MACHINEFILE_OPTION} ${MACHINEFILE} -np 1 ${COMMAND} | tee ${LOG} @@ -62,6 +78,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate create on single client failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR_SINGLE 'f%%d' --ignore exit 1 @@ -104,6 +121,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate create on multiple nodes failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR_MULTI 'f%%d' --ignore exit 1 @@ -125,6 +143,7 @@ else rmdir $TESTDIR_MULTI fi +restore_lustre_params < $p rmdir $BASEDIR || true rm -f $MACHINEFILE check_and_cleanup_lustre diff --git a/lustre/tests/mdsrate-create-small.sh b/lustre/tests/mdsrate-create-small.sh index 2e87c66..79e7638 100644 --- a/lustre/tests/mdsrate-create-small.sh +++ b/lustre/tests/mdsrate-create-small.sh @@ -38,7 +38,16 @@ log "===== $0 ====== " check_and_setup_lustre -mkdir -p $BASEDIR +MDSRATE_ENABLE_DNE=${MDSRATE_ENABLE_DNE:-false} +if $MDSRATE_ENABLE_DNE; then + test_mkdir $BASEDIR + mdtcount_opt="--mdtcount $MDSCOUNT" +else + mkdir $BASEDIR +fi +if $VERBOSE; then + debug_opt="--debug" +fi chmod 0777 $BASEDIR mdsrate_STRIPEPARAMS=${mdsrate_STRIPEPARAMS:-${fs_STRIPEPARAMS:-"-i 0 -c 1"}} setstripe_getstripe $BASEDIR $mdsrate_STRIPEPARAMS @@ -48,7 +57,13 @@ if [ $IFree -lt $NUM_FILES ]; then NUM_FILES=$IFree fi -generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" +generate_machine_file $NODES_TO_USE $MACHINEFILE || + error "can not generate machinefile" + +p="$TMP/$TESTSUITE-$TESTNAME.parameters" +save_lustre_params $(get_facets MDS) mdt.*.enable_remote_dir_gid > $p +do_nodes $(comma_list $(mdts_nodes)) \ + $LCTL set_param mdt.*.enable_remote_dir_gid=-1 if [ -n "$NOSINGLE" ]; then echo "NO Tests on single client." @@ -62,7 +77,8 @@ else log "===== $0 ### 1 NODE CREATE ###" COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD} - --nfiles $NUM_FILES --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'" + --nfiles $NUM_FILES --dir ${TESTDIR_SINGLE} --filefmt 'f%%d' + $mdtcount_opt $debug_opt" echo "+ ${COMMAND}" mpi_run ${MACHINEFILE_OPTION} ${MACHINEFILE} -np 1 ${COMMAND} | tee ${LOG} @@ -70,6 +86,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate create on single client failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR_SINGLE 'f%%d' --ignore exit 1 @@ -121,6 +138,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate create on multiple nodes failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $((NUM_CLIENTS * THREADS_PER_CLIENT)) \ $MACHINEFILE $NUM_FILES \ $TESTDIR_MULTI 'f%%d' --ignore @@ -149,6 +167,7 @@ else fi complete $SECONDS +restore_lustre_params < $p rmdir $BASEDIR || true rm -f $MACHINEFILE check_and_cleanup_lustre diff --git a/lustre/tests/mdsrate-lookup-10dirs.sh b/lustre/tests/mdsrate-lookup-10dirs.sh index 7dd3c59..2d235ff 100644 --- a/lustre/tests/mdsrate-lookup-10dirs.sh +++ b/lustre/tests/mdsrate-lookup-10dirs.sh @@ -37,7 +37,16 @@ log "===== $0 ====== " check_and_setup_lustre -mkdir -p $BASEDIR +MDSRATE_ENABLE_DNE=${MDSRATE_ENABLE_DNE:-false} +if $MDSRATE_ENABLE_DNE; then + test_mkdir $BASEDIR + mdtcount_opt="--mdtcount $MDSCOUNT" +else + mkdir $BASEDIR +fi +if $VERBOSE; then + debug_opt="--debug" +fi chmod 0777 $BASEDIR mdsrate_STRIPEPARAMS=${mdsrate_STRIPEPARAMS:-${fs_STRIPEPARAMS:-"-c 1"}} setstripe_getstripe $BASEDIR $mdsrate_STRIPEPARAMS @@ -47,7 +56,13 @@ if [ $IFree -lt $((NUM_FILES * NUM_DIRS)) ]; then NUM_FILES=$((IFree / NUM_DIRS)) fi -generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" +generate_machine_file $NODES_TO_USE $MACHINEFILE || + error "can not generate machinefile" + +p="$TMP/$TESTSUITE-$TESTNAME.parameters" +save_lustre_params $(get_facets MDS) mdt.*.enable_remote_dir_gid > $p +do_nodes $(comma_list $(mdts_nodes)) \ + $LCTL set_param mdt.*.enable_remote_dir_gid=-1 DIRfmt="${BASEDIR}/lookup-%d" @@ -70,9 +85,10 @@ else log "===== $0 Test preparation: creating ${NUM_DIRS} dirs with ${NUM_FILES} files." - COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod - --ndirs ${NUM_DIRS} --dirfmt '${DIRfmt}' - --nfiles ${NUM_FILES} --filefmt 'f%%d'" + COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod + --ndirs ${NUM_DIRS} --dirfmt '${DIRfmt}' + --nfiles ${NUM_FILES} --filefmt 'f%%d' + $mdtcount_opt $debug_opt" echo "+" ${COMMAND} # For files creation we can use -np equal to NUM_DIRS @@ -85,6 +101,7 @@ else # No lookup if error occurs on file creation, abort. if [ ${PIPESTATUS[0]} != 0 ]; then error_noexit "mdsrate file creation failed, aborting" + restore_lustre_params < $p mdsrate_cleanup_all exit 1 fi @@ -106,6 +123,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate lookup on single client failed, aborting" + restore_lustre_params < $p mdsrate_cleanup_all exit 1 fi @@ -124,12 +142,14 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate lookup on multiple nodes failed, aborting" + restore_lustre_params < $p mdsrate_cleanup_all exit 1 fi fi complete $SECONDS +restore_lustre_params < $p mdsrate_cleanup_all rmdir $BASEDIR || true rm -f $MACHINEFILE diff --git a/lustre/tests/mdsrate-lookup-1dir.sh b/lustre/tests/mdsrate-lookup-1dir.sh index 221a405..ea73dc9 100644 --- a/lustre/tests/mdsrate-lookup-1dir.sh +++ b/lustre/tests/mdsrate-lookup-1dir.sh @@ -36,7 +36,16 @@ log "===== $0 ====== " check_and_setup_lustre -mkdir -p $BASEDIR +MDSRATE_ENABLE_DNE=${MDSRATE_ENABLE_DNE:-false} +if $MDSRATE_ENABLE_DNE; then + test_mkdir $BASEDIR + mdtcount_opt="--mdtcount $MDSCOUNT" +else + mkdir $BASEDIR +fi +if $VERBOSE; then + debug_opt="--debug" +fi chmod 0777 $BASEDIR mdsrate_STRIPEPARAMS=${mdsrate_STRIPEPARAMS:-${fs_STRIPEPARAMS:-"-c 1"}} setstripe_getstripe $BASEDIR $mdsrate_STRIPEPARAMS @@ -46,7 +55,13 @@ if [ $IFree -lt $NUM_FILES ]; then NUM_FILES=$IFree fi -generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" +generate_machine_file $NODES_TO_USE $MACHINEFILE || + error "can not generate machinefile" + +p="$TMP/$TESTSUITE-$TESTNAME.parameters" +save_lustre_params $(get_facets MDS) mdt.*.enable_remote_dir_gid > $p +do_nodes $(comma_list $(mdts_nodes)) \ + $LCTL set_param mdt.*.enable_remote_dir_gid=-1 if [ -n "$NOCREATE" ]; then echo "NOCREATE=$NOCREATE => no file creation." @@ -60,8 +75,9 @@ else if [ $NUM_CLIENTS -gt 50 ]; then NUM_THREADS=$NUM_CLIENTS fi - COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir ${TESTDIR} - --nfiles ${NUM_FILES} --filefmt 'f%%d'" + COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir ${TESTDIR} + --nfiles ${NUM_FILES} --filefmt 'f%%d' + $mdtcount_opt $debug_opt" echo "+" ${COMMAND} mpi_run ${MACHINEFILE_OPTION} ${MACHINEFILE} -np ${NUM_THREADS} \ ${COMMAND} 2>&1 @@ -69,6 +85,7 @@ else # No lockup if error occurs on file creation, abort. if [ ${PIPESTATUS[0]} != 0 ]; then error_noexit "mdsrate file creation failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_THREADS $MACHINEFILE $NUM_FILES \ $TESTDIR 'f%%d' --ignore exit 1 @@ -90,6 +107,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate lookup on single client failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR 'f%%d' --ignore exit 1 @@ -109,6 +127,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate lookup on multiple nodes failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR 'f%%d' --ignore exit 1 @@ -116,6 +135,7 @@ else fi complete $SECONDS +restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rmdir $BASEDIR || true rm -f $MACHINEFILE diff --git a/lustre/tests/mdsrate-stat-large.sh b/lustre/tests/mdsrate-stat-large.sh index 12e7a8c..02625bc 100644 --- a/lustre/tests/mdsrate-stat-large.sh +++ b/lustre/tests/mdsrate-stat-large.sh @@ -37,7 +37,16 @@ log "===== $0 ====== " check_and_setup_lustre -mkdir -p $BASEDIR +MDSRATE_ENABLE_DNE=${MDSRATE_ENABLE_DNE:-false} +if $MDSRATE_ENABLE_DNE; then + test_mkdir $BASEDIR + mdtcount_opt="--mdtcount $MDSCOUNT" +else + mkdir $BASEDIR +fi +if $VERBOSE; then + debug_opt="--debug" +fi chmod 0777 $BASEDIR mdsrate_STRIPEPARAMS=${mdsrate_STRIPEPARAMS:-${fs_STRIPEPARAMS:-"-c -1"}} setstripe_getstripe $BASEDIR $mdsrate_STRIPEPARAMS @@ -47,7 +56,13 @@ if [ $IFree -lt $NUM_FILES ]; then NUM_FILES=$IFree fi -generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" +generate_machine_file $NODES_TO_USE $MACHINEFILE || + error "can not generate machinefile" + +p="$TMP/$TESTSUITE-$TESTNAME.parameters" +save_lustre_params $(get_facets MDS) mdt.*.enable_remote_dir_gid > $p +do_nodes $(comma_list $(mdts_nodes)) \ + $LCTL set_param mdt.*.enable_remote_dir_gid=-1 if [ -n "$NOCREATE" ]; then echo "NOCREATE=$NOCREATE => no file creation." @@ -56,9 +71,10 @@ else log "===== $0 Test preparation: creating ${NUM_FILES} files." - COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --dir ${TESTDIR} - --nfiles ${NUM_FILES} --filefmt 'f%%d'" - echo "+" ${COMMAND} + COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --dir ${TESTDIR} + --nfiles ${NUM_FILES} --filefmt 'f%%d' + $mdtcount_opt $debug_opt" + echo "+" ${COMMAND} NUM_CLIENTS=$(get_node_count ${NODES_TO_USE//,/ }) NUM_THREADS=$((NUM_CLIENTS * MDSCOUNT)) @@ -93,6 +109,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate stat on single client failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR 'f%%d' --ignore exit 1 @@ -113,6 +130,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate stat on multiple nodes failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR 'f%%d' --ignore exit 1 @@ -121,6 +139,7 @@ fi complete $SECONDS +restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rmdir $BASEDIR || true rm -f $MACHINEFILE diff --git a/lustre/tests/mdsrate-stat-small.sh b/lustre/tests/mdsrate-stat-small.sh index 062061e..f2ab39c 100644 --- a/lustre/tests/mdsrate-stat-small.sh +++ b/lustre/tests/mdsrate-stat-small.sh @@ -37,7 +37,16 @@ log "===== $0 ====== " check_and_setup_lustre -mkdir -p $BASEDIR +MDSRATE_ENABLE_DNE=${MDSRATE_ENABLE_DNE:-false} +if $MDSRATE_ENABLE_DNE; then + test_mkdir $BASEDIR + mdtcount_opt="--mdtcount $MDSCOUNT" +else + mkdir $BASEDIR +fi +if $VERBOSE; then + debug_opt="--debug" +fi chmod 0777 $BASEDIR mdsrate_STRIPEPARAMS=${mdsrate_STRIPEPARAMS:-${fs_STRIPEPARAMS:-"-i 0 -c 1"}} setstripe_getstripe $BASEDIR $mdsrate_STRIPEPARAMS @@ -47,7 +56,13 @@ if [ $IFree -lt $NUM_FILES ]; then NUM_FILES=$IFree fi -generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile" +generate_machine_file $NODES_TO_USE $MACHINEFILE || + error "can not generate machinefile" + +p="$TMP/$TESTSUITE-$TESTNAME.parameters" +save_lustre_params $(get_facets MDS) mdt.*.enable_remote_dir_gid > $p +do_nodes $(comma_list $(mdts_nodes)) \ + $LCTL set_param mdt.*.enable_remote_dir_gid=-1 if [ -n "$NOCREATE" ]; then echo "NOCREATE=$NOCREATE => no file creation." @@ -56,9 +71,10 @@ else log "===== $0 Test preparation: creating ${NUM_FILES} files." - COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir ${TESTDIR} - --nfiles ${NUM_FILES} --filefmt 'f%%d'" - echo "+" ${COMMAND} + COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir ${TESTDIR} + --nfiles ${NUM_FILES} --filefmt 'f%%d' + $mdtcount_opt $debug_opt" + echo "+" ${COMMAND} NUM_CLIENTS=$(get_node_count ${NODES_TO_USE//,/ }) NUM_THREADS=$((NUM_CLIENTS * MDSCOUNT)) @@ -71,6 +87,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then error_noexit "mdsrate file creation failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_THREADS $MACHINEFILE $NUM_FILES \ $TESTDIR 'f%%d' --ignore exit 1 @@ -93,6 +110,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate stat on single client failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR 'f%%d' --ignore exit 1 @@ -113,6 +131,7 @@ else if [ ${PIPESTATUS[0]} != 0 ]; then [ -f $LOG ] && sed -e "s/^/log: /" $LOG error_noexit "mdsrate stat on multiple nodes failed, aborting" + restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES \ $TESTDIR 'f%%d' --ignore exit 1 @@ -120,6 +139,7 @@ else fi complete $SECONDS +restore_lustre_params < $p mdsrate_cleanup $NUM_CLIENTS $MACHINEFILE $NUM_FILES $TESTDIR 'f%%d' rmdir $BASEDIR || true rm -f $MACHINEFILE diff --git a/lustre/tests/mpi/mdsrate.c b/lustre/tests/mpi/mdsrate.c index ea15ebc..fc0f7c6 100644 --- a/lustre/tests/mpi/mdsrate.c +++ b/lustre/tests/mpi/mdsrate.c @@ -118,7 +118,7 @@ int openflags = O_RDWR | O_CREAT | O_EXCL; int ndirs = 1; char *dirfmt; char dir[PATH_MAX]; -char mkdir_cmd[PATH_MAX + 32]; +char mkdir_cmd[PATH_MAX + 48]; int dirthreads; int dirnum; DIR *directory; @@ -539,8 +539,9 @@ process_args(int argc, char *argv[]) if (!S_ISDIR(sb.st_mode)) fatal(myrank, "'%s' is not dir\n", dir); } else if (errno == ENOENT) { - sprintf(mkdir_cmd, "lfs mkdir -i %d %s", - myrank % mdt_count, dir); + sprintf(mkdir_cmd, "lfs mkdir -i %d -c %d %s", + rand() % mdt_count, + rand() % mdt_count + 1, dir); } else { fatal(myrank, "'%s' stat failed\n", dir); } @@ -548,11 +549,22 @@ process_args(int argc, char *argv[]) sprintf(mkdir_cmd, "mkdir -p %s", dir); } - dmesg("%d: %s\n", myrank, mkdir_cmd); #ifdef _LIGHTWEIGHT_KERNEL printf("NOTICE: not running system(%s)\n", mkdir_cmd); #else - rc = system(mkdir_cmd); + if (ndirs == 1) { + if (myrank == 0) { + dmesg("%d: %s\n", myrank, mkdir_cmd); + rc = system(mkdir_cmd); + } else { + rc = 0; + } + if (MPI_Barrier(MPI_COMM_WORLD) != MPI_SUCCESS) + fatal(myrank, "mkdir MPI_Barrier failed\n"); + } else { + dmesg("%d: %s\n", myrank, mkdir_cmd); + rc = system(mkdir_cmd); + } if (rc) fatal(myrank, "'%s' failed.\n", mkdir_cmd); #endif -- 1.8.3.1