Split benchmark file system setup and execution into separate steps.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Mon, 14 Feb 2011 03:01:14 +0000 (19:01 -0800)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Mon, 14 Feb 2011 03:01:14 +0000 (19:01 -0800)
microbench/run2.sh
microbench/setup/prepare-benchmark [new file with mode: 0755]
microbench/setup/run-benchmark

index 3bcc2e5..24f4348 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-PARAMS="BLUESKY_CACHE_SIZE BLUESKY_TARGET BENCH_DURATION BENCH_FILESIZE BENCH_FILECOUNT BENCH_WRITERATIO BENCH_THREADS BENCH_OPS"
+PARAMS="BLUESKY_CACHE_SIZE BLUESKY_TARGET BENCH_DURATION BENCH_FILESIZE BENCH_FILECOUNT BENCH_WRITERATIO BENCH_THREADS BENCH_OPS BENCH_INTERVALS"
 
 BENCHER=c09-44.sysnet.ucsd.edu
 PROXY=c09-45.sysnet.ucsd.edu
@@ -16,7 +16,7 @@ get_params() {
 run_cmd() {
     host="$1"; shift
     cmd="$1"; shift
-    echo "EXECUTE($host):" "$cmd" "$@"
+    echo "EXECUTE($host):" "$cmd" "$@" 1>&2
     ssh -l root $host /scratch/bluesky.git/microbench/setup/$cmd "$@" $(get_params)
 }
 
@@ -35,6 +35,7 @@ for size in 512; do
     run_cmd $PROXY run-proxy >$PREFIX.proxy 2>&1 &
     proxy_pid=$!
     sleep 10
+    run_cmd $BENCHER prepare-benchmark
     run_cmd $BENCHER run-benchmark | tee $PREFIX.results
     run_cmd $PROXY stop-proxy
     echo "Waiting for proxy to stop..."
diff --git a/microbench/setup/prepare-benchmark b/microbench/setup/prepare-benchmark
new file mode 100755 (executable)
index 0000000..0102705
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+#
+# Prepare a file system for a benchmark run by creating any needed files or
+# directories.
+
+
+# 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
+BENCH_INTERVALS=4
+
+# 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 >/dev/null
+
+for t in $(seq 0 $(($BENCH_THREADS - 1))); do
+    mkdir t$t
+    for i in $(seq 0 $(($BENCH_FILECOUNT - 1))); do
+        dd if=/dev/zero of=t$t/$i bs=$BENCH_FILESIZE count=1
+    done
+done
+
+popd >/dev/null
+
+umount -f $MNTDIR
index 2942f48..bf061a4 100755 (executable)
@@ -29,13 +29,6 @@ mount -t nfs -o vers=3,tcp,rw,soft,intr $SERVER:/export $MNTDIR
 
 pushd $MNTDIR >/dev/null
 
-for t in $(seq 0 $(($BENCH_THREADS - 1))); do
-    mkdir t$t
-    for i in $(seq 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 \