Whamcloud - gitweb
LU-676 tests: machinefile option for mpirun via a variable
authorJay J. Lan <jay.j.lan@nasa.gov>
Tue, 18 Oct 2011 19:04:07 +0000 (12:04 -0700)
committerJohann Lombardi <johann.lombardi@intel.com>
Tue, 11 Dec 2012 15:21:25 +0000 (10:21 -0500)
Not all MPI implementations pass the host file to mpirun via the same
option. Common options are -machinefile and -hostfile.

This problem can be resolved by using a variable MACHINEFILE_OPTION
instead. A default value is assigned if the variable not defined.

Signed-off-by: Jay J Lan <jay.j.lan@nasa.gov>
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I3362a6e62a27318cff733aea2f99b1356b3ff02e
Reviewed-on: http://review.whamcloud.com/1540
Tested-by: Hudson
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
14 files changed:
lustre/tests/Makefile.am
lustre/tests/cfg/local.sh
lustre/tests/functions.sh
lustre/tests/ha.sh
lustre/tests/large-scale.sh
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/metadata-updates.sh
lustre/tests/run_IOR.sh
lustre/tests/test-framework.sh

index d28e183..6b122ef 100644 (file)
@@ -25,6 +25,7 @@ noinst_SCRIPTS += recovery-random-scale.sh parallel-scale.sh metadata-updates.sh
 noinst_SCRIPTS += ost-pools.sh rpc.sh lnet-selftest.sh obdfilter-survey.sh mmp.sh mmp_mark.sh
 noinst_SCRIPTS += sgpdd-survey.sh auster yaml.sh maloo_upload.sh setup-nfs.sh
 noinst_SCRIPTS += parallel-scale-nfs.sh parallel-scale-nfsv3.sh parallel-scale-nfsv4.sh
+noinst_SCRIPTS += ha.sh
 nobase_noinst_SCRIPTS = cfg/local.sh
 nobase_noinst_SCRIPTS += test-groups/regression test-groups/regression-mpi
 nobase_noinst_SCRIPTS += acl/make-tree acl/run cfg/ncli.sh
index 8a4a9f8..7792f18 100644 (file)
@@ -110,6 +110,7 @@ FAIL_ON_ERROR=${FAIL_ON_ERROR:-true}
 
 MPIRUN=$(which mpirun 2>/dev/null) || true
 MPI_USER=${MPI_USER:-mpiuser}
+MACHINEFILE_OPTION=${MACHINEFILE_OPTION:-"-machinefile"}
 
 # This is used by a small number of tests to share state between the client
 # running the tests, or in some cases between the servers (e.g. lfsck.sh).
index 5b12290..27acca5 100644 (file)
@@ -207,7 +207,7 @@ run_metabench() {
             -n $((num_clients * mbench_THREADS)) -p $SRUN_PARTITION -- $cmd
     else
         mpi_run -np $((num_clients * $mbench_THREADS)) \
-            -machinefile ${MACHINEFILE} $cmd
+            ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
     fi
 
     local rc=$?
@@ -254,7 +254,7 @@ run_simul() {
             -n $((num_clients * simul_THREADS)) -p $SRUN_PARTITION -- $cmd
     else
         mpi_run -np $((num_clients * simul_THREADS)) \
-            -machinefile ${MACHINEFILE} $cmd
+            ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
     fi
 
     local rc=$?
@@ -309,7 +309,7 @@ run_mdtest() {
             -n $((num_clients * mdtest_THREADS)) -p $SRUN_PARTITION -- $cmd
     else
         mpi_run -np $((num_clients * mdtest_THREADS)) \
-            -machinefile ${MACHINEFILE} $cmd
+            ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
     fi
 
     local rc=$?
@@ -442,7 +442,7 @@ run_ior() {
             -n $((num_clients * ior_THREADS)) -p $SRUN_PARTITION -- $cmd
     else
         mpi_run -np $((num_clients * $ior_THREADS)) \
-            -machinefile ${MACHINEFILE} $cmd
+            ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
     fi
 
     local rc=$?
@@ -495,7 +495,7 @@ run_mib() {
             -n $((num_clients * mib_THREADS)) -p $SRUN_PARTITION -- $cmd
     else
         mpi_run -np $((num_clients * mib_THREADS)) \
-            -machinefile ${MACHINEFILE} $cmd
+            ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
     fi
 
     local rc=$?
@@ -537,7 +537,7 @@ run_cascading_rw() {
 
     echo "+ $cmd"
     mpi_run -np $((num_clients * $casc_THREADS)) \
-        -machinefile ${MACHINEFILE} $cmd
+        ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
@@ -579,7 +579,7 @@ run_write_append_truncate() {
 
     echo "+ $cmd"
     mpi_run -np $((num_clients * $write_THREADS)) \
-        -machinefile ${MACHINEFILE} $cmd
+        ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
@@ -619,7 +619,7 @@ run_write_disjoint() {
 
     echo "+ $cmd"
     mpi_run -np $((num_clients * $wdisjoint_THREADS)) \
-        -machinefile ${MACHINEFILE} $cmd
+        ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
@@ -661,7 +661,7 @@ run_parallel_grouplock() {
         echo "+ $cmd"
 
         mpi_run -np $parallel_grouplock_MINTASKS \
-            -machinefile ${MACHINEFILE} $cmd
+            ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
         local rc=$?
         if [ $rc != 0 ] ; then
             error_noexit "parallel_grouplock subtests $subtest failed! $rc"
@@ -736,7 +736,7 @@ run_statahead () {
     local cmd="$cmd1 $cmd2"
     echo "+ $cmd"
 
-    mpi_run -np $((num_clients * 32)) -machinefile ${MACHINEFILE} $cmd
+    mpi_run -np $((num_clients * 32)) ${MACHINEFILE_OPTION} ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
index d978419..2b61537 100755 (executable)
@@ -277,7 +277,8 @@ ha_repeat_mpi_load()
     while [ ! -e "$ha_stop_file" ] && ((rc == 0)); do
         {
             ha_on ${ha_clients[0]} mkdir -p "$dir" &&                       \
-            mpirun -np ${#ha_clients[@]} -machinefile "$ha_machine_file"    \
+            mpirun -np ${#ha_clients[@]} ${MACHINEFILE_OPTION}              \
+                       "$ha_machine_file"                                   \
                    $cmd &&                                                  \
             ha_on ${ha_clients[0]} rm -rf "$dir"
         } >>"$log" 2>&1 || rc=$?
index d7b6ce2..d7ea02d 100644 (file)
@@ -215,7 +215,8 @@ test_3a() {
             mdsrate_cleanup $num $machinefile $nfiles $dir 'f%%d' --ignore
 
             COMMAND="${MDSRATE} --create --nfiles $nfiles --dir $dir --filefmt 'f%%d'"
-            mpi_run -np $((num * nthreads)) -machinefile $machinefile ${COMMAND} | tee ${LOG} &
+            mpi_run -np $((num * nthreads)) ${MACHINEFILE_OPTION} $machinefile \
+                        ${COMMAND} | tee ${LOG} &
 
             pid=$!
             echo "pid=$pid"
index 0ff62a2..e67e20e 100644 (file)
@@ -56,7 +56,7 @@ else
     COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD}
                 --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'"
     echo "+ ${COMMAND}"
-    mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np 1 ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
        [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -73,7 +73,7 @@ else
     COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink
                 --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'"
     echo "+ ${COMMAND}"
-    mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np 1 ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} | tee ${LOG}
  
     if [ ${PIPESTATUS[0]} != 0 ]; then
        [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -97,7 +97,8 @@ else
     COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD}
                 --nfiles $NUM_FILES --dir ${TESTDIR_MULTI} --filefmt 'f%%d'"
     echo "+ ${COMMAND}"
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
        [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -114,7 +115,8 @@ else
     COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink
                 --nfiles ${NUM_FILES} --dir ${TESTDIR_MULTI} --filefmt 'f%%d'"
     echo "+ ${COMMAND}"
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
        [ -f $LOG ] && sed -e "s/^/log: /" $LOG
index 8cfb415..27a5e4c 100644 (file)
@@ -64,7 +64,8 @@ else
         COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD}
                     --nfiles $NUM_FILES --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'"
         echo "+ ${COMMAND}"
-        mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+        mpi_run -np 1 ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+                | tee ${LOG}
 
         if [ ${PIPESTATUS[0]} != 0 ]; then
             [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -85,7 +86,8 @@ else
         COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink
                      --nfiles ${NUM_FILES} --dir ${TESTDIR_SINGLE} --filefmt 'f%%d'"
         echo "+ ${COMMAND}"
-        mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+        mpi_run -np 1 ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+                | tee ${LOG}
 
         if [ ${PIPESTATUS[0]} != 0 ]; then
             [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -112,8 +114,8 @@ else
         COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --create --time ${TIME_PERIOD}
                     --nfiles $NUM_FILES --dir ${TESTDIR_MULTI} --filefmt 'f%%d'"
         echo "+ ${COMMAND}"
-        mpi_run -np $((NUM_CLIENTS * THREADS_PER_CLIENT)) -machinefile ${MACHINEFILE} \
-            ${COMMAND} | tee ${LOG}
+        mpi_run -np $((NUM_CLIENTS * THREADS_PER_CLIENT)) ${MACHINEFILE_OPTION} \
+                ${MACHINEFILE} ${COMMAND} | tee ${LOG}
         if [ ${PIPESTATUS[0]} != 0 ]; then
             [ -f $LOG ] && sed -e "s/^/log: /" $LOG
             error "mdsrate create on multiple nodes failed, aborting"
@@ -133,8 +135,8 @@ else
         COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --unlink
                       --nfiles ${NUM_FILES} --dir ${TESTDIR_MULTI} --filefmt 'f%%d'"
         echo "+ ${COMMAND}"
-        mpi_run -np $((NUM_CLIENTS * THREADS_PER_CLIENT)) -machinefile ${MACHINEFILE} \
-            ${COMMAND} | tee ${LOG}
+        mpi_run -np $((NUM_CLIENTS * THREADS_PER_CLIENT)) ${MACHINEFILE_OPTION} \
+                ${MACHINEFILE} ${COMMAND} | tee ${LOG}
         if [ ${PIPESTATUS[0]} != 0 ]; then
             [ -f $LOG ] && sed -e "s/^/log: /" $LOG
             error "mdsrate unlinks multiple nodes failed, aborting"
index 4655834..9cdffc9 100644 (file)
@@ -70,7 +70,7 @@ else
     # For files creation we can use -np equal to NUM_DIRS 
     # This is just a test preparation, does not matter how many threads we use for files creation;
     # we just should be aware that NUM_DIRS is less than or equal to the number of threads np
-    mpi_run -np ${NUM_DIRS} -machinefile ${MACHINEFILE} ${COMMAND} 2>&1 
+    mpi_run -np ${NUM_DIRS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} 2>&1
 
     # No lookup if error occurs on file creation, abort.
     [ ${PIPESTATUS[0]} != 0 ] && error "mdsrate file creation failed, aborting"
@@ -86,7 +86,7 @@ if [ -n "$NOSINGLE" ]; then
 else
     log "===== $0 ### 1 NODE LOOKUPS ###"
     echo "+" ${COMMAND}
-    mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np 1 ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -101,7 +101,8 @@ if [ -n "$NOMULTI" ]; then
 else
     log "===== $0 ### ${NUM_CLIENTS} NODES LOOKUPS ###"
     echo "+" ${COMMAND}
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && sed -e "s/^/log: /" $LOG
index b86a8b7..efa4911 100644 (file)
@@ -58,7 +58,8 @@ else
     COMMAND="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir ${TESTDIR}
                         --nfiles ${NUM_FILES} --filefmt 'f%%d'"
     echo "+" ${COMMAND}
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} 2>&1 
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            2>&1
 
     # No lockup if error occurs on file creation, abort.
     [ ${PIPESTATUS[0]} != 0 ] && error "mdsrate file creation failed, aborting"
@@ -73,7 +74,7 @@ if [ -n "$NOSINGLE" ]; then
 else
     log "===== $0 ### 1 NODE LOOKUPS ###"
     echo "+" ${COMMAND}
-    mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np 1 ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -88,7 +89,8 @@ if [ -n "$NOMULTI" ]; then
 else
     log "===== $0 ### ${NUM_CLIENTS} NODES LOOKUPS ###"
     echo "+" ${COMMAND}
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && sed -e "s/^/log: /" $LOG
index b0dff02..d4e405c 100644 (file)
@@ -61,7 +61,8 @@ else
                         --nfiles ${NUM_FILES} --filefmt 'f%%d'"
     echo "+" ${COMMAND}
 
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} 2>&1
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            2>&1
     [ ${PIPESTATUS[0]} != 0 ] && error "mdsrate file creation failed, aborting"
 
 fi
@@ -76,7 +77,7 @@ else
     log "===== $0 ### 1 NODE STAT ###"
     echo "+" ${COMMAND}
 
-    mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np 1 ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -92,7 +93,8 @@ else
     log "===== $0 ### ${NUM_CLIENTS} NODES STAT ###"
     echo "+" ${COMMAND}
 
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && sed -e "s/^/log: /" $LOG
index 40db5ed..67cdafe 100644 (file)
@@ -61,7 +61,8 @@ else
                         --nfiles ${NUM_FILES} --filefmt 'f%%d'"
     echo "+" ${COMMAND}
 
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} 2>&1
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            2>&1
     [ ${PIPESTATUS[0]} != 0 ] && error "mdsrate file creation failed, aborting"
 
 fi
@@ -76,7 +77,7 @@ else
     log "===== $0 ### 1 NODE STAT ###"
     echo "+" ${COMMAND}
 
-    mpi_run -np 1 -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np 1 ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} | tee ${LOG}
     
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && sed -e "s/^/log: /" $LOG
@@ -92,7 +93,8 @@ else
     log "===== $0 ### ${NUM_CLIENTS} NODES STAT ###"
     echo "+" ${COMMAND}
 
-    mpi_run -np ${NUM_CLIENTS} -machinefile ${MACHINEFILE} ${COMMAND} | tee ${LOG}
+    mpi_run -np ${NUM_CLIENTS} ${MACHINEFILE_OPTION} ${MACHINEFILE} ${COMMAND} \
+            | tee ${LOG}
 
     if [ ${PIPESTATUS[0]} != 0 ]; then
         [ -f $LOG ] && sed -e "s/^/log: /" $LOG
index a698981..7dac370 100755 (executable)
@@ -254,8 +254,9 @@ if [ -f "$WRITE_DISJOINT" ]; then
     set $TRACE
     MACHINEFILE=${MACHINEFILE:-$TMP/$(basename $0 .sh).machines}
     generate_machine_file $NODES_TO_USE $MACHINEFILE
-    mpi_run -np $(get_node_count ${NODES_TO_USE//,/ }) -machinefile $MACHINEFILE \
-    $WRITE_DISJOINT -f $WRITE_DISJOINT_FILE -n $NUMLOOPS || STATUS=1
+    mpi_run -np $(get_node_count ${NODES_TO_USE//,/ }) ${MACHINEFILE_OPTION} \
+            $MACHINEFILE $WRITE_DISJOINT -f $WRITE_DISJOINT_FILE -n $NUMLOOPS \
+            || STATUS=1
 else
     skip_env "$0 : write_disjoint not found "
 fi
index 9f8f816..f6d98cd 100755 (executable)
@@ -44,8 +44,9 @@ while [ ! -e "$END_RUN_FILE" ] && $CONTINUE; do
     # need this only if TESTDIR is not default
     chmod -R 777 $TESTDIR
 
-    mpi_run -np $((NUM_CLIENTS * THREADS_PER_CLIENT)) -machinefile ${MACHINEFILE} \
-        $IOR -a POSIX -b 1g -o $TESTDIR/IOR-file -s 1 -t 1m -v -w -r 1>$LOG &
+    mpi_run -np $((NUM_CLIENTS * THREADS_PER_CLIENT)) ${MACHINEFILE_OPTION} \
+            ${MACHINEFILE} $IOR -a POSIX -b 1g -o $TESTDIR/IOR-file -s 1 -t 1m \
+            -v -w -r 1>$LOG &
     load_pid=$!
     wait $load_pid
     if [ ${PIPESTATUS[0]} -eq 0 ]; then
index f244a98..5f96dd0 100644 (file)
@@ -3433,7 +3433,8 @@ get_stripe_info() {
 }
 
 mdsrate_cleanup () {
-    mpi_run -np $1 -machinefile $2 ${MDSRATE} --unlink --nfiles $3 --dir $4 --filefmt $5 $6
+    mpi_run -np $1 ${MACHINEFILE_OPTION} $2 ${MDSRATE} --unlink --nfiles $3 \
+            --dir $4 --filefmt $5 $6
 }
 
 delayed_recovery_enabled () {