-test_ior() {
- [ x$IOR = x ] &&
- { skip_env "IOR not found" && return; }
-
- local clients=$CLIENTS
- [ -z $clients ] && clients=$(hostname)
-
- local num_clients=$(get_node_count ${clients//,/ })
-
- 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
-
- generate_machine_file $clients $MACHINEFILE || \
- error "can not generate machinefile $MACHINEFILE"
-
- print_opts IOR ior_THREADS ior_DURATION MACHINEFILE
-
- local testdir=$DIR/d0.ior
- mkdir -p $testdir
- # mpi_run uses mpiuser
- chmod 0777 $testdir
-
- #
- # -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 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
-
- local rc=$?
- if [ $rc != 0 ] ; then
- error "ior failed! $rc"
- fi
- rm -rf $testdir