changeset 48:f60c0246c8ce

add ring experiment shell script
author kazz <kazz@cr.ie.u-ryukyu.ac.jp>
date Sat, 04 Feb 2012 16:27:10 +0900
parents 5b6624b2f055
children ed0ff4512e8c
files scripts/ring_experiment.sh scripts/ring_manager_run.sh scripts/ring_run.sh src/alice/test/topology/ring/FirstRingMessagePassing.java
diffstat 4 files changed, 33 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/ring_experiment.sh	Sat Feb 04 16:27:10 2012 +0900
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+cnt=$1 # start num
+d=$2   # diff
+max=$3 # max num
+
+while [ $cnt -lt $max ]
+do
+    ./ring_run.sh 10 $cnt
+    cnt=`expr $cnt + $d`
+done
+wait
--- a/scripts/ring_manager_run.sh	Sat Feb 04 16:05:14 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-if [ ! -d output ]; then
-    mkdir output
-fi
-
-max=$1
-count=$2
-ruby ./topology/ring.rb $1 > ./topology/ring.dot
-dot -Tpng ./topology/ring.dot > ./topology/ring.png
-open ./topology/ring.png
-java -cp ../Alice.jar alice.topology.manager.TopologyManager -p 10000 -conf ./topology/ring.dot -log ./output/manager.log -level info &
-
-cnt=0
-while [ $cnt -lt $max ]
-do
-    java -cp ../Alice.jar alice.test.topology.ring.RingTopology -host `hostname` -port 10000 -p `expr 20000 + $cnt` -log ./output/ring${cnt}.log -level info -count $count &
-    cnt=`expr $cnt + 1`
-done
-wait
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/ring_run.sh	Sat Feb 04 16:27:10 2012 +0900
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if [ ! -d output ]; then
+    mkdir output
+fi
+
+max=$1
+count=$2
+ruby ./topology/ring.rb $1 > ./topology/ring.dot
+#dot -Tpng ./topology/ring.dot > ./topology/ring.png
+#open ./topology/ring.png
+java -cp ../Alice.jar alice.topology.manager.TopologyManager -p 10000 -conf ./topology/ring.dot -log ./output/manager.log -level info &
+
+cnt=0
+while [ $cnt -lt $max ]
+do
+    java -cp ../Alice.jar alice.test.topology.ring.RingTopology -host `hostname` -port 10000 -p `expr 20000 + $cnt` -log ./output/ring${cnt}.log -level info -count $count &
+    cnt=`expr $cnt + 1`
+done
+wait
--- a/src/alice/test/topology/ring/FirstRingMessagePassing.java	Sat Feb 04 16:05:14 2012 +0900
+++ b/src/alice/test/topology/ring/FirstRingMessagePassing.java	Sat Feb 04 16:27:10 2012 +0900
@@ -28,7 +28,7 @@
 			ods.put("right", "finish", ValueFactory.createNilValue());
 			Date endTime = new Date();
 			long time = endTime.getTime() - startTime.getTime();
-			System.out.println(time);
+			System.out.println(count + ", " + time);
 			return;	
 		}