d01a3a3497bc00e99163dd717331d66cb5d46e78
[bluesky.git] / microbench / run2.sh
1 #!/bin/bash
2
3 PARAMS="BLUESKY_CACHE_SIZE BLUESKY_TARGET BENCH_DURATION BENCH_FILESIZE BENCH_FILECOUNT BENCH_WRITERATIO BENCH_THREADS BENCH_OPS BENCH_INTERVALS BENCH_DIRSIZE"
4
5 BENCHER=c09-44.sysnet.ucsd.edu
6 PROXY=c09-45.sysnet.ucsd.edu
7
8 SSH_ARGS=""
9
10 get_params() {
11     for p in $PARAMS; do
12         if [ -n "${!p}" ]; then
13             echo "$p=${!p}"
14         fi
15     done
16 }
17
18 run_cmd() {
19     host="$1"; shift
20     cmd="$1"; shift
21     echo "EXECUTE($host):" "$cmd" "$@" 1>&2
22     ssh $SSH_ARGS -l root $host /scratch/bluesky.git/microbench/setup/$cmd "$@" $(get_params)
23 }
24
25 BLUESKY_TARGET=s3
26 BLUESKY_CACHE_SIZE=$((512 * 1024))
27 BENCH_FILESIZE=$((1 << 20))
28 BENCH_FILECOUNT=$((62))
29 BENCH_WRITERATIO=0.0
30 BENCH_THREADS=4
31 BENCH_DURATION=120
32 BENCH_INTERVALS=10
33 BENCH_DIRSIZE=128
34
35 #for size in 128 256 512 768 1024 1536 2048; do
36 #    for filesize in 4 32 256 2048; do
37 run_experiments() {
38 for size in 128 512 1024 2048; do
39     for filesize in 1024; do
40         BENCH_FILESIZE=$(($filesize * 1024))
41         BENCH_FILECOUNT=$(($size * 1024 / $filesize / $BENCH_THREADS))
42         PREFIX=$BLUESKY_TARGET-$BENCH_WRITERATIO-${size}M-${filesize}k
43
44         $HOME/bin/s3-cleanup.py
45         SSH_ARGS="-t"
46         run_cmd $PROXY cleanup-proxy
47         SSH_ARGS=""
48         run_cmd $PROXY run-proxy >$PREFIX.proxy 2>&1 &
49         proxy_pid=$!
50         sleep 10
51         run_cmd $BENCHER prepare-benchmark
52
53         #for BENCH_OPS in 2000 1500 1000 800 600 400 200 100 80 40 20 10; do
54         for BENCH_OPS in 2000 1000 500 200 100 50 20 10; do
55             sleep 10
56             echo "SETTINGS:" $(get_params)
57             get_params >$PREFIX-$BENCH_OPS.settings
58             run_cmd $BENCHER run-benchmark | tee $PREFIX-$BENCH_OPS.results
59         done
60
61         run_cmd $PROXY stop-proxy
62         echo "Waiting for proxy to stop..."
63         wait $proxy_pid
64     done
65 done
66 }
67
68 BLUESKY_TARGET=native
69 run_experiments
70
71 BENCH_WRITERATIO=1.0
72 run_experiments
73
74 ssh -l root $PROXY pkill -TERM lockmem
75
76 BLUESKY_TARGET=s3
77 run_experiments