4b590e311853c80778747975afb09bd2afc3ba04
[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
17 # Export any environment variables specified on the command line
18 for e in "$@"; do
19     echo "$e" 1>&2
20     if echo "$e" | grep = >/dev/null; then
21         eval "$e"
22         export ${e%=*}
23     fi
24 done
25
26 # Prepare to run the benchmark
27 mount -t nfs -o vers=3,tcp,rw,soft,intr $SERVER:/export $MNTDIR
28
29 pushd $MNTDIR
30
31 for t in $(seq 0 $(($BENCH_THREADS - 1))); do
32     mkdir t$t
33     for i in {0..$(($BENCH_FILECOUNT - 1))}; do
34         dd if=/dev/zero of=t$t/$i bs=$BENCH_FILESIZE count=1
35     done
36 done
37
38 /scratch/bluesky.git/microbench/mixedbench \
39     $BENCH_FILESIZE \
40     $BENCH_FILECOUNT \
41     $BENCH_WRITERATIO \
42     $BENCH_THREADS \
43     $BENCH_DURATION \
44     $BENCH_OPS
45
46 popd
47
48 umount -f $MNTDIR