Newer
Older
#SBATCH -J arrh-storage-benchmark
usage() {
echo "Usage: sbatch -N <number of nodes> --cpus-per-task=<threads per node> storage-benchmark.sbatch [ sequential <blocksize> | iops | meta ] <bytes or files per thread> <directory>"
exit 2
}
info() {
echo "storage-benchmark.sbatch:" "$@"
}
##
## Argument handling
##
MODE=$1
then
BLOCKSIZE=$2
shift
elif [ "$MODE" = iops ] || [ "$MODE" = meta ]
then :
else usage
fi
BYTES_OR_FILES=$2
if [ -z "$BYTES_OR_FILES" ]
then usage
fi
DIRECTORY=$3
if [ -z "$DIRECTORY" ]
then usage
fi
NNODES=$SLURM_NNODES
THREADS=$SLURM_CPUS_PER_TASK
HOSTS=$(scontrol show hostnames | tr '\n' ',')
info "Mode: $MODE"
if [ "$BLOCKSIZE" ]
fi
info "Number of nodes: $NNODES"
info "Threads per node: $THREADS"
elbencho --version
##
## The benchmark
##
info "Starting service on all nodes"
srun --ntasks-per-node=1 elbencho --service --foreground > /dev/null &
info "Starting storage benchmark"
echo
then
elbencho --hosts "$HOSTS" --rotatehosts=1 -t "$THREADS" \
-w -r -b "$BLOCKSIZE" -s "$BYTES_OR_FILES" -n 0 -F "$DIRECTORY"
elif [ "$MODE" = iops ]
then
elbencho --hosts "$HOSTS" --rotatehosts=1 -t "$THREADS" \
-w -r -b 4K -s "$BYTES_OR_FILES" -n 0 -F --rand "$DIRECTORY"
elif [ "$MODE" = meta ]
then
elbencho --hosts "$HOSTS" --rotatehosts=1 -t "$THREADS" \
-d -w --stat -F -N "$BYTES_OR_FILES" -D "$DIRECTORY"
fi
echo
info "Benchmark done"
elbencho --hosts "$HOSTS" --quit