Add script to run a simple microbenchmark.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Wed, 9 Feb 2011 23:26:54 +0000 (15:26 -0800)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Wed, 9 Feb 2011 23:26:54 +0000 (15:26 -0800)
microbench/setup/run-benchmark [new file with mode: 0755]

diff --git a/microbench/setup/run-benchmark b/microbench/setup/run-benchmark
new file mode 100755 (executable)
index 0000000..4b590e3
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+# Start up the NFS server.
+
+
+# Defaults
+SERVER=c09-45.sysnet.ucsd.edu
+MNTDIR=/mnt/bluesky
+
+BENCH_FILESIZE=$((1 << 12))
+BENCH_FILECOUNT=$((8))
+BENCH_WRITERATIO=1.0
+BENCH_THREADS=8
+BENCH_DURATION=120
+BENCH_OPS=100
+
+# Export any environment variables specified on the command line
+for e in "$@"; do
+    echo "$e" 1>&2
+    if echo "$e" | grep = >/dev/null; then
+        eval "$e"
+        export ${e%=*}
+    fi
+done
+
+# Prepare to run the benchmark
+mount -t nfs -o vers=3,tcp,rw,soft,intr $SERVER:/export $MNTDIR
+
+pushd $MNTDIR
+
+for t in $(seq 0 $(($BENCH_THREADS - 1))); do
+    mkdir t$t
+    for i in {0..$(($BENCH_FILECOUNT - 1))}; do
+        dd if=/dev/zero of=t$t/$i bs=$BENCH_FILESIZE count=1
+    done
+done
+
+/scratch/bluesky.git/microbench/mixedbench \
+    $BENCH_FILESIZE \
+    $BENCH_FILECOUNT \
+    $BENCH_WRITERATIO \
+    $BENCH_THREADS \
+    $BENCH_DURATION \
+    $BENCH_OPS
+
+popd
+
+umount -f $MNTDIR