commit e98198666289b42c19925b9751d2716232c349a9
Author: Jason Rappleye <jason.rappleye@nasa.gov>
Date:   Thu Jun 2 10:52:54 2011 -0700

    Select machinefile option for mpirun via a variable.
    
    Not all MPI implementations pass the host file to mpirun via the same
    option. Common options are -machinefile and -hostfile. Modify mpi_run
    to use MACHINEFILE_OPTION instead.
    
    Corrected another instance of this problem that appeared since the
    cherry-picked commit was originally made.
    
    (cherry picked from commit e2de66b618614b6e550ba097aa6880a564f52dc6)
    
    Author:    Jason Rappleye <jason.rappleye@nasa.gov>
    Committer: Jay Lan <jlan@sgi.com>
    
    	modified:   lustre/tests/large-scale.sh
    	modified:   lustre/tests/mdsrate-create-large.sh
    	modified:   lustre/tests/mdsrate-create-small.sh
    	modified:   lustre/tests/mdsrate-lookup-10dirs.sh
    	modified:   lustre/tests/mdsrate-lookup-1dir.sh
    	modified:   lustre/tests/mdsrate-stat-large.sh
    	modified:   lustre/tests/mdsrate-stat-small.sh
    	modified:   lustre/tests/metadata-updates.sh
    	modified:   lustre/tests/parallel-scale.sh
    	modified:   lustre/tests/run_IOR.sh
    	modified:   lustre/tests/test-framework.sh

diff --git a/lustre/tests/large-scale.sh b/lustre/tests/large-scale.sh
index d7b6ce2..920ab48 100644
--- a/lustre/tests/large-scale.sh
+++ b/lustre/tests/large-scale.sh
@@ -215,7 +215,7 @@ 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"
diff --git a/lustre/tests/mdsrate-create-large.sh b/lustre/tests/mdsrate-create-large.sh
index 0ff62a2..d9a56c0 100644
--- a/lustre/tests/mdsrate-create-large.sh
+++ b/lustre/tests/mdsrate-create-large.sh
@@ -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,7 @@ 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 +114,7 @@ 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
diff --git a/lustre/tests/mdsrate-create-small.sh b/lustre/tests/mdsrate-create-small.sh
index 8cfb415..55629d4 100644
--- a/lustre/tests/mdsrate-create-small.sh
+++ b/lustre/tests/mdsrate-create-small.sh
@@ -64,7 +64,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
@@ -85,7 +85,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
@@ -112,7 +112,7 @@ 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} \
+        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
@@ -133,7 +133,7 @@ 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} \
+        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
diff --git a/lustre/tests/mdsrate-lookup-10dirs.sh b/lustre/tests/mdsrate-lookup-10dirs.sh
index 4655834..2146fc9 100644
--- a/lustre/tests/mdsrate-lookup-10dirs.sh
+++ b/lustre/tests/mdsrate-lookup-10dirs.sh
@@ -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,7 @@ 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
diff --git a/lustre/tests/mdsrate-lookup-1dir.sh b/lustre/tests/mdsrate-lookup-1dir.sh
index b86a8b7..9b0159b 100644
--- a/lustre/tests/mdsrate-lookup-1dir.sh
+++ b/lustre/tests/mdsrate-lookup-1dir.sh
@@ -58,7 +58,7 @@ 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 +73,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 +88,7 @@ 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
diff --git a/lustre/tests/mdsrate-stat-large.sh b/lustre/tests/mdsrate-stat-large.sh
index b0dff02..124ff27 100644
--- a/lustre/tests/mdsrate-stat-large.sh
+++ b/lustre/tests/mdsrate-stat-large.sh
@@ -61,7 +61,7 @@ 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 +76,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 +92,7 @@ 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
diff --git a/lustre/tests/mdsrate-stat-small.sh b/lustre/tests/mdsrate-stat-small.sh
index 40db5ed..4523715 100644
--- a/lustre/tests/mdsrate-stat-small.sh
+++ b/lustre/tests/mdsrate-stat-small.sh
@@ -61,7 +61,7 @@ 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 +76,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 +92,7 @@ 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
diff --git a/lustre/tests/metadata-updates.sh b/lustre/tests/metadata-updates.sh
index a698981..4496426 100755
--- a/lustre/tests/metadata-updates.sh
+++ b/lustre/tests/metadata-updates.sh
@@ -254,7 +254,7 @@ 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 \
+    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 "
diff --git a/lustre/tests/parallel-scale.sh b/lustre/tests/parallel-scale.sh
index 365684d..547daea 100644
--- a/lustre/tests/parallel-scale.sh
+++ b/lustre/tests/parallel-scale.sh
@@ -182,7 +182,7 @@ test_metabench() {
     # -k             Cleanup.  Remove the test directories.
     local cmd="$METABENCH -w $testdir -c $mbench_NFILES -C -S -k"
     echo "+ $cmd"
-    mpi_run -np $((num_clients * $mbench_THREADS)) -machinefile ${MACHINEFILE} $cmd
+    mpi_run -np $((num_clients * $mbench_THREADS)) $MACHINEFILE_OPTION ${MACHINEFILE} $cmd
     local rc=$?
     if [ $rc != 0 ] ; then
         error "metabench failed! $rc"
@@ -223,7 +223,7 @@ test_simul() {
     local cmd="$SIMUL -d $testdir -n $simul_REP -N $simul_REP"
 
     echo "+ $cmd"
-    mpi_run -np $((num_clients * $simul_THREADS)) -machinefile ${MACHINEFILE} $cmd
+    mpi_run -np $((num_clients * $simul_THREADS)) $MACHINEFILE_OPTION ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
@@ -334,7 +334,7 @@ test_ior() {
     local cmd="$IOR -a POSIX -b ${ior_blockSize}g -o $testdir/iorData -t 2m -v -w -r -T $ior_DURATION -k"
 
     echo "+ $cmd"
-    mpi_run -np $((num_clients * $ior_THREADS)) -machinefile ${MACHINEFILE} $cmd
+    mpi_run -np $((num_clients * $ior_THREADS)) $MACHINEFILE_OPTION ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
@@ -376,7 +376,7 @@ test_cascading_rw() {
     local cmd="$CASC_RW -g -d $testdir -n $casc_REP"
 
     echo "+ $cmd"
-    mpi_run -np $((num_clients * $casc_THREADS)) -machinefile ${MACHINEFILE} $cmd
+    mpi_run -np $((num_clients * $casc_THREADS)) $MACHINEFILE_OPTION ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
@@ -420,7 +420,7 @@ test_write_append_truncate() {
     local cmd="write_append_truncate -n $write_REP $file"
 
     echo "+ $cmd"
-    mpi_run -np $((num_clients * $write_THREADS)) -machinefile ${MACHINEFILE} $cmd
+    mpi_run -np $((num_clients * $write_THREADS)) $MACHINEFILE_OPTION ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
@@ -459,7 +459,7 @@ test_write_disjoint() {
     local cmd="$WRITE_DISJOINT -f $testdir/file -n $wdisjoint_REP"
 
     echo "+ $cmd"
-    mpi_run -np $((num_clients * $wdisjoint_THREADS)) -machinefile ${MACHINEFILE} $cmd
+    mpi_run -np $((num_clients * $wdisjoint_THREADS)) $MACHINEFILE_OPTION ${MACHINEFILE} $cmd
 
     local rc=$?
     if [ $rc != 0 ] ; then
@@ -503,7 +503,7 @@ test_parallel_grouplock() {
         local cmd="$PARALLEL_GROUPLOCK -g -v -d $testdir $subtest"
         echo "+ $cmd"
 
-        mpi_run -np $parallel_grouplock_MINTASKS -machinefile ${MACHINEFILE} $cmd
+        mpi_run -np $parallel_grouplock_MINTASKS $MACHINEFILE_OPTION ${MACHINEFILE} $cmd
         local rc=$?
         if [ $rc != 0 ] ; then
             error_noexit "parallel_grouplock subtests $subtest failed! $rc"
@@ -581,8 +581,8 @@ test_statahead () {
 
     local cmd="${MDSRATE} ${MDSRATE_DEBUG} --mknod --dir $testdir --nfiles $num_files --filefmt 'f%%d'"
     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
diff --git a/lustre/tests/run_IOR.sh b/lustre/tests/run_IOR.sh
index 6da7f54..a36ac27 100755
--- a/lustre/tests/run_IOR.sh
+++ b/lustre/tests/run_IOR.sh
@@ -41,7 +41,7 @@ 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} \
+    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
diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh
index 011a198..2bb8581 100644
--- a/lustre/tests/test-framework.sh
+++ b/lustre/tests/test-framework.sh
@@ -3293,7 +3293,7 @@ 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 () {
