diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-09 21:45:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-09 21:45:03 +0000 |
commit | 02102b75a9664460555ae0947350582293465abd (patch) | |
tree | 6afbd835d361722977b9aa8f241fdb175c6c8c6e /src/scalarproduct/perf_scalarproduct.sh | |
parent | e0f0366f920a4681be3ceb60bb86ecc82d14ce54 (diff) | |
download | gnunet-02102b75a9664460555ae0947350582293465abd.tar.gz gnunet-02102b75a9664460555ae0947350582293465abd.zip |
-running at scale...
Diffstat (limited to 'src/scalarproduct/perf_scalarproduct.sh')
-rwxr-xr-x | src/scalarproduct/perf_scalarproduct.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/scalarproduct/perf_scalarproduct.sh b/src/scalarproduct/perf_scalarproduct.sh new file mode 100755 index 000000000..35a6d872c --- /dev/null +++ b/src/scalarproduct/perf_scalarproduct.sh | |||
@@ -0,0 +1,43 @@ | |||
1 | #!/bin/bash | ||
2 | # compute a simple scalar product | ||
3 | # payload for this test: | ||
4 | SIZE=1000 | ||
5 | INPUTALICE="-k CCC -e '" | ||
6 | INPUTBOB="-k CCC -e '" | ||
7 | for X in `seq 1 $SIZE` | ||
8 | do | ||
9 | INPUTALICE="${INPUTALICE}A${X},$X;" | ||
10 | INPUTBOB="${INPUTBOB}A${X},$X;" | ||
11 | done | ||
12 | INPUTALICE="${INPUTALICE}BC,-20000;RO,1000;FL,100;LOL,24;'" | ||
13 | INPUTBOB="${INPUTBOB}AB,10;RO,3;FL,3;LOL,-1;'" | ||
14 | |||
15 | # necessary to make the testing prefix deterministic, so we can access the config files | ||
16 | PREFIX=/tmp/test-scalarproduct`date +%H%M%S` | ||
17 | |||
18 | # where can we find the peers config files? | ||
19 | CFGALICE="-c $PREFIX/0/config" | ||
20 | CFGBOB="-c $PREFIX/1/config" | ||
21 | |||
22 | # launch two peers in line topology non-interactively | ||
23 | # | ||
24 | # interactive mode would terminate the test immediately | ||
25 | # because the rest of the script is already in stdin, | ||
26 | # thus redirecting stdin does not suffice) | ||
27 | GNUNET_FORCE_LOG=';;;;ERROR' | ||
28 | GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 & | ||
29 | PID=$! | ||
30 | # sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe | ||
31 | echo "Waiting for peers to start..." | ||
32 | sleep 5 | ||
33 | # get Bob's peer ID, necessary for Alice | ||
34 | PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB` | ||
35 | |||
36 | echo "Running problem of size $SIZE" | ||
37 | gnunet-scalarproduct $CFGBOB $INPUTBOB & | ||
38 | time RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB` | ||
39 | |||
40 | echo "Terminating testbed..." | ||
41 | # terminate the testbed | ||
42 | kill $PID | ||
43 | |||