2942f48c21ef8bac4072e0d6e63c457b86d4aac4
[bluesky.git] / microbench / setup / run-benchmark
1 #!/bin/bash
2 #
3 # Start up the NFS server.
4
5
6 # Defaults
7 SERVER=c09-45.sysnet.ucsd.edu
8 MNTDIR=/mnt/bluesky
9
10 BENCH_FILESIZE=$((1 << 12))
11 BENCH_FILECOUNT=$((8))
12 BENCH_WRITERATIO=1.0
13 BENCH_THREADS=8
14 BENCH_DURATION=120
15 BENCH_OPS=100
16 BENCH_INTERVALS=4
17
18 # Export any environment variables specified on the command line
19 for e in "$@"; do
20     echo "$e" 1>&2
21     if echo "$e" | grep = >/dev/null; then
22         eval "$e"
23         export ${e%=*}
24     fi
25 done
26
27 # Prepare to run the benchmark
28 mount -t nfs -o vers=3,tcp,rw,soft,intr $SERVER:/export $MNTDIR
29
30 pushd $MNTDIR >/dev/null
31
32 for t in $(seq 0 $(($BENCH_THREADS - 1))); do
33     mkdir t$t
34     for i in $(seq 0 $(($BENCH_FILECOUNT - 1))); do
35         dd if=/dev/zero of=t$t/$i bs=$BENCH_FILESIZE count=1
36     done
37 done
38
39 /scratch/bluesky.git/microbench/mixedbench \
40     $BENCH_FILESIZE \
41     $BENCH_FILECOUNT \
42     $BENCH_WRITERATIO \
43     $BENCH_THREADS \
44     $BENCH_DURATION \
45     $BENCH_OPS \
46     $BENCH_INTERVALS
47
48 popd >/dev/null
49
50 umount -f $MNTDIR