More reworking of microbenchmark handling of reads/writes and file layout.
[bluesky.git] / microbench / setup / prepare-benchmark
index 0102705..eb5c7d5 100755 (executable)
@@ -15,6 +15,7 @@ BENCH_THREADS=8
 BENCH_DURATION=120
 BENCH_OPS=100
 BENCH_INTERVALS=4
+BENCH_DIRSIZE=256
 
 # Export any environment variables specified on the command line
 for e in "$@"; do
@@ -30,13 +31,15 @@ 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
+mkdir $(seq 0 $(($BENCH_FILECOUNT / $BENCH_DIRSIZE)))
+for i in $(seq 0 $(($BENCH_FILECOUNT - 1))); do
+    n1=$(($i / $BENCH_DIRSIZE))
+    n2=$(($i % $BENCH_DIRSIZE))
+    dd if=/dev/zero of=$n1/$n2 bs=$BENCH_FILESIZE count=1
 done
 
+find -type f -exec sha1sum '{}' \;
+
 popd >/dev/null
 
 umount -f $MNTDIR