Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / tests / mdsrate-lookup-1dir.sh
index 1645781..eb5f497 100644 (file)
@@ -15,7 +15,7 @@ init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 assert_env CLIENTS MDSRATE SINGLECLIENT MPIRUN
 
-MACHINEFILE=${MACHINEFILE:-$(basename $0 .sh).machines}
+MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
 TESTDIR=$MOUNT
 
 # Requirements
@@ -37,7 +37,7 @@ log "===== $0 ====== "
 
 check_and_setup_lustre
 
-generate_machine_file $NODES_TO_USE $MACHINEFILE
+generate_machine_file $NODES_TO_USE $MACHINEFILE || error "can not generate machinefile"
 
 $LFS setstripe $TESTDIR -c 1
 get_stripe $TESTDIR
@@ -56,8 +56,7 @@ else
     COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir ${TESTDIR}
                         --nfiles ${NUM_FILES} --filefmt 'f%%d'"
     echo "+" ${COMMAND}
-    $MPIRUN -np ${NUM_THREADS} -machinefile ${MACHINEFILE} \
-          ${MPIRUN_OPTIONS} ${COMMAND} 2>&1 
+    mpi_run -np ${NUM_THREADS} -machinefile ${MACHINEFILE} ${COMMAND} 2>&1 
 
     # No lockup if error occurs on file creation, abort.
     [ ${PIPESTATUS[0]} != 0 ] && error "mpirun ... mdsrate ... file creation failed, aborting"
@@ -73,8 +72,7 @@ else
     log "===== $0 ### 1 NODE LOOKUPS ###"
     echo "Running lookups on 1 node(s)."
     echo "+" ${COMMAND}
-    $MPIRUN -np 1 -machinefile ${MACHINEFILE} \
-        ${MPIRUN_OPTIONS} ${COMMAND} | tee ${LOG}
+    mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && cat $LOG
@@ -90,8 +88,7 @@ else
     log "===== $0 ### ${NUM_CLIENTS} NODES LOOKUPS ###"
     echo "Running lookups on ${NUM_CLIENTS} node(s)."
     echo "+" ${COMMAND}
-    $MPIRUN -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} \
-        ${MPIRUN_OPTIONS} ${COMMAND} | tee ${LOG}
+    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && cat $LOG
@@ -101,6 +98,7 @@ else
 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