path: root/src/scalarproduct/
diff options
authorChristian Grothoff <>2014-12-09 21:45:03 +0000
committerChristian Grothoff <>2014-12-09 21:45:03 +0000
commit02102b75a9664460555ae0947350582293465abd (patch)
tree6afbd835d361722977b9aa8f241fdb175c6c8c6e /src/scalarproduct/
parente0f0366f920a4681be3ceb60bb86ecc82d14ce54 (diff)
-running at scale...
Diffstat (limited to 'src/scalarproduct/')
1 files changed, 43 insertions, 0 deletions
diff --git a/src/scalarproduct/ b/src/scalarproduct/
new file mode 100755
index 000000000..35a6d872c
--- /dev/null
+++ b/src/scalarproduct/
@@ -0,0 +1,43 @@
+# compute a simple scalar product
+# payload for this test:
+INPUTBOB="-k CCC -e '"
+for X in `seq 1 $SIZE`
+# necessary to make the testing prefix deterministic, so we can access the config files
+PREFIX=/tmp/test-scalarproduct`date +%H%M%S`
+# where can we find the peers config files?
+CFGALICE="-c $PREFIX/0/config"
+CFGBOB="-c $PREFIX/1/config"
+# launch two peers in line topology non-interactively
+# interactive mode would terminate the test immediately
+# because the rest of the script is already in stdin,
+# thus redirecting stdin does not suffice)
+GNUNET_TESTING_PREFIX=$PREFIX ../testbed/gnunet-testbed-profiler -n -c test_scalarproduct.conf -p 2 &
+# sleep 1 is too short on most systems, 2 works on most, 5 seems to be safe
+echo "Waiting for peers to start..."
+sleep 5
+# get Bob's peer ID, necessary for Alice
+PEERIDBOB=`gnunet-peerinfo -qs $CFGBOB`
+echo "Running problem of size $SIZE"
+gnunet-scalarproduct $CFGBOB $INPUTBOB &
+time RESULT=`gnunet-scalarproduct $CFGALICE $INPUTALICE -p $PEERIDBOB`
+echo "Terminating testbed..."
+# terminate the testbed
+kill $PID