-test_ior() {
- local type=${1:="ssf"}
-
- [ x$IOR = x ] &&
- { skip_env "IOR not found" && return; }
-
- local space=$(df -P $DIR | tail -n 1 | awk '{ print $4 }')
- echo "+ $ior_blockSize * 1024 * 1024 * $num_clients * $ior_THREADS "
- if [ $((space / 2)) -le $(( ior_blockSize * 1024 * 1024 * num_clients * ior_THREADS)) ]; then
- echo "+ $space * 9/10 / 1024 / 1024 / $num_clients / $ior_THREADS"
- ior_blockSize=$(( space /2 /1024 /1024 / num_clients / ior_THREADS ))
- [ $ior_blockSize = 0 ] && \
- skip_env "Need free space more than ($num_clients * $ior_THREADS )Gb: $((num_clients*ior_THREADS *1024 *1024*2)), have $space" && return
-
- echo "free space=$space, Need: $num_clients x $ior_THREADS x $ior_blockSize Gb (blockSize reduced to $ior_blockSize Gb)"
- fi
-
- print_opts IOR ior_THREADS ior_DURATION MACHINEFILE
-
- local testdir=$DIR/d0.ior
- mkdir -p $testdir
- # mpi_run uses mpiuser
- chmod 0777 $testdir
- if [ "$NFSCLIENT" ]; then
- setstripe_nfsserver $testdir -c -1 ||
- { error "setstripe on nfsserver failed" && return 1; }
- else
- $LFS setstripe $testdir -c -1 ||
- { error "setstripe failed" && return 2; }
- fi
- #
- # -b N blockSize -- contiguous bytes to write per task (e.g.: 8, 4k, 2m, 1g)"
- # -o S testFileName
- # -t N transferSize -- size of transfer in bytes (e.g.: 8, 4k, 2m, 1g)"
- # -w writeFile -- write file"
- # -r readFile -- read existing file"
- # -T maxTimeDuration -- max time in minutes to run tests"
- # -k keepFile -- keep testFile(s) on program exit
-
- local cmd="$IOR -a $ior_type -b ${ior_blockSize}g -o $testdir/iorData -t $ior_xferSize -v -w -r -i $ior_iteration -T $ior_DURATION -k"
- [ $type = "fpp" ] && cmd="$cmd -F"
-
- echo "+ $cmd"
- # find out if we need to use srun by checking $SRUN_PARTITION
- if [ "$SRUN_PARTITION" ]; then
- $SRUN $SRUN_OPTIONS -D $testdir -w $clients -N $num_clients \
- -n $((num_clients * ior_THREADS)) -p $SRUN_PARTITION -- $cmd
- else
- mpi_run -np $((num_clients * $ior_THREADS)) -machinefile ${MACHINEFILE} $cmd
- fi
-
- local rc=$?
- if [ $rc != 0 ] ; then
- error "ior failed! $rc"
- fi
- rm -rf $testdir
-}
-