- thr_per_dir=$((${thr}/${dir_count}))
- # skip if no enough thread
- if (( thr_per_dir <= 0 )); then
- continue
- fi
- file_count_per_thread=$((${file_count}/${thr}))
- str=`printf 'mdt %1d file %7d dir %4d thr %4d ' \
- $ndevs $file_count $dir_count $thr`
- echo "=======================> $str" >> $workf
- print_summary -n "$str"
- # run tests
- for test in ${tests[@]}; do
- declare -a pidarray
- for host in ${unique_hosts[@]}; do
- echo "starting run for config: $config test: $test file: \
- $file_count threads: $thr directories: $dir_count" >> ${vmstatf}_${host}
- done
- print_summary -n "$test "
- # create per-host script files
- for host in ${unique_hosts[@]}; do
- echo -n > ${cmdsf}_${host}
- done
- for ((idx = 0; idx < $ndevs; idx++)); do
- host=${host_names[$idx]}
- devno=${devnos[$idx]}
- dirname="$(printf "${mdtbasedir}" ${client_indexes[$idx]})$basedir"
- tmpfi="${tmpf}_$idx"
- [ "$test" = "create" ] && test="create -c $stripe_count"
- echo >> ${cmdsf}_${host} \
- "$lctl > $tmpfi 2>&1 \
- --threads $thr -$snap $devno test_$test -d /$dirname -D $dir_count \
- -b $start_number -n $file_count_per_thread"
- done
- pidcount=0
- for host in ${unique_hosts[@]}; do
- echo "wait" >> ${cmdsf}_${host}
- pidarray[$pidcount]=0
- pidcount=$((pidcount+1))
- done
- pidcount=0
- for host in ${unique_hosts[@]}; do
- remote_shell $host bash < ${cmdsf}_${host} &
- pidarray[$pidcount]=$!
- pidcount=$((pidcount+1))
- done
- pidcount=0
- for host in ${unique_hosts[@]}; do
- wait ${pidarray[$pidcount]}
- pidcount=$((pidcount+1))
- done
- #wait
- # clean up per-host script files
- for host in ${unique_hosts[@]}; do
- rm ${cmdsf}_${host}
- done
-
- # collect/check individual MDT stats
- echo -n > $tmpf
- for ((idx = 0; idx < $ndevs; idx++)); do
- client_name="${host_names[$idx]}:${client_names[$idx]}"
- tmpfi="${tmpf}_$idx"
- echo "=============> $test $client_name" >> $workf
- host="${host_names[$idx]}"
- remote_shell $host cat $tmpfi > ${tmpfi}_local
- cat ${tmpfi}_local >> $workf
- get_stats ${tmpfi}_local >> $tmpf
- rm -f $tmpfi ${tmpfi}_local
- done
- # compute/display global min/max stats
- echo "=============> $test global" >> $workf
- cat $tmpf >> $workf
- stats=(`get_global_stats $tmpf`)
- rm $tmpf
- if ((stats[0] <= 0)); then
- str=`printf "%17s " ERROR`
- status=1
- else
- str=`awk "BEGIN {printf \"%7.2f [ %7.2f, %7.2f] \", \
- ${stats[1]}, ${stats[2]}, ${stats[3]}; exit}"`
- fi
- print_summary -n "$str"
- done
- print_summary ""
+ thr_per_dir=$((${thr}/${dir_count}))
+ # skip if no enough thread
+ if (( thr_per_dir <= 0 )); then
+ continue
+ fi
+ file_count_per_thread=$((${file_count}/${thr}))
+ str=$(printf 'mdt %1d file %7d dir %4d thr %4d ' \
+ $ndevs $file_count $dir_count $thr)
+ echo "=======> $str" >> $workf
+ print_summary -n "$str"
+ # run tests
+ for test in ${tests[@]}; do
+ declare -a pidarray
+ for host in ${unique_hosts[@]}; do
+ echo "starting run for config: $config test: $test " \
+ "file: $file_count threads: $thr " \
+ "directories: $dir_count" >> ${vmstatf}_${host}
+ done
+ print_summary -n "$test "
+ # create per-host script files
+ for host in ${unique_hosts[@]}; do
+ echo -n > ${cmdsf}_${host}
+ done
+ for ((idx = 0; idx < $ndevs; idx++)); do
+ host=${host_names[$idx]}
+ devno=${devnos[$idx]}
+ dirname="$(printf "${mdtbasedir}" ${client_indexes[$idx]})$basedir"
+ tmpfi="${tmpf}_$idx"
+ [ "$test" = "create" ] && test="create -c $stripe_count"
+ echo >> ${cmdsf}_${host} \
+ "$LCTL > $tmpfi 2>&1 \
+ --threads $thr -$snap $devno test_$test \
+ -d /$dirname -D $dir_count \
+ -b $start_number -n $file_count_per_thread"
+ done
+ pidcount=0
+ for host in ${unique_hosts[@]}; do
+ echo "wait" >> ${cmdsf}_${host}
+ pidarray[$pidcount]=0
+ pidcount=$((pidcount+1))
+ done
+ pidcount=0
+ for host in ${unique_hosts[@]}; do
+ remote_shell $host bash < ${cmdsf}_${host} &
+ pidarray[$pidcount]=$!
+ pidcount=$((pidcount+1))
+ done
+ pidcount=0
+ for host in ${unique_hosts[@]}; do
+ wait ${pidarray[$pidcount]}
+ pidcount=$((pidcount+1))
+ done
+ #wait
+ # clean up per-host script files
+ for host in ${unique_hosts[@]}; do
+ rm ${cmdsf}_${host}
+ done
+
+ # collect/check individual MDT stats
+ echo -n > $tmpf
+ for ((idx = 0; idx < $ndevs; idx++)); do
+ client_name="${host_names[$idx]}:${client_names[$idx]}"
+ tmpfi="${tmpf}_$idx"
+ echo "=============> $test $client_name" >> $workf
+ host="${host_names[$idx]}"
+ remote_shell $host cat $tmpfi > ${tmpfi}_local
+ cat ${tmpfi}_local >> $workf
+ get_stats ${tmpfi}_local >> $tmpf
+ rm -f $tmpfi ${tmpfi}_local
+ done
+ # compute/display global min/max stats
+ echo "=============> $test global" >> $workf
+ cat $tmpf >> $workf
+ stats=($(get_global_stats $tmpf))
+ rm $tmpf
+ if ((stats[0] <= 0)); then
+ str=$(printf "%17s " ERROR)
+ status=1
+ else
+ str=$(awk "BEGIN {printf \"%7.2f [ %7.2f, %7.2f] \", \
+ ${stats[1]}, ${stats[2]}, ${stats[3]}; exit}")
+ fi
+ print_summary -n "$str"
+ done
+ print_summary ""