Spread test files for mixedbench across multiple subdirectories.
[bluesky.git] / microbench / setup / prepare-benchmark
index 0102705..bb6907e 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
@@ -33,10 +34,15 @@ 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
+        n1=$(($i / $BENCH_DIRSIZE))
+        n2=$(($i % $BENCH_DIRSIZE))
+        mkdir t$t/$n1
+        dd if=/dev/zero of=t$t/$n1/$n2 bs=$BENCH_FILESIZE count=1
     done
 done
 
+find -type f -exec sha1sum '{}' \;
+
 popd >/dev/null
 
 umount -f $MNTDIR