# HG changeset patch # User kazz # Date 1328777604 -32400 # Node ID ead04b49630522f75dc43af6ee653b22c360b765 # Parent 84cfcc8e1bce2cfcbdf882a7d8c312c531cb492c change print relay count to node num on ring diff -r 84cfcc8e1bce -r ead04b496305 src/alice/test/topology/ring/CheckMyName.java --- a/src/alice/test/topology/ring/CheckMyName.java Thu Feb 09 05:02:25 2012 +0900 +++ b/src/alice/test/topology/ring/CheckMyName.java Thu Feb 09 17:53:24 2012 +0900 @@ -21,7 +21,7 @@ logger.debug(host); if (host.equals("node0")) { ods.put("local", "counter", new byte[conf.size]); - FirstRingMessagePassing cs1 = new FirstRingMessagePassing(System.nanoTime(), conf.count); + FirstRingMessagePassing cs1 = new FirstRingMessagePassing(System.nanoTime(), conf.count, conf.nodeNum); cs1.counter.setKey("local", "counter"); RingFinish cs2 = new RingFinish("manager"); cs2.finish.setKey("local", "finish"); diff -r 84cfcc8e1bce -r ead04b496305 src/alice/test/topology/ring/FirstRingMessagePassing.java --- a/src/alice/test/topology/ring/FirstRingMessagePassing.java Thu Feb 09 05:02:25 2012 +0900 +++ b/src/alice/test/topology/ring/FirstRingMessagePassing.java Thu Feb 09 17:53:24 2012 +0900 @@ -10,11 +10,13 @@ public Receiver counter = ids.create(CommandType.TAKE); private long startTime; - private int count; + private int count; + private int nodeNum; - public FirstRingMessagePassing(long startTime, int count) { + public FirstRingMessagePassing(long startTime, int count, int nodeNum) { this.startTime = startTime; this.count = count; + this.nodeNum = nodeNum; } @Override @@ -24,11 +26,11 @@ ods.put("right", "finish", ValueFactory.createNilValue()); long endTime = System.nanoTime(); long time = endTime - startTime; - System.out.println(count + ", " + time / count); + System.out.println(nodeNum + ", " + time / count); return; } - FirstRingMessagePassing cs = new FirstRingMessagePassing(startTime, count); + FirstRingMessagePassing cs = new FirstRingMessagePassing(startTime, count, nodeNum); cs.counter.setKey("local", "counter"); } diff -r 84cfcc8e1bce -r ead04b496305 src/alice/test/topology/ring/RingTopologyConfig.java --- a/src/alice/test/topology/ring/RingTopologyConfig.java Thu Feb 09 05:02:25 2012 +0900 +++ b/src/alice/test/topology/ring/RingTopologyConfig.java Thu Feb 09 17:53:24 2012 +0900 @@ -6,6 +6,7 @@ public int count = 10; public int size = 10; + public int nodeNum = 10; public RingTopologyConfig(String[] args) { super(args); @@ -14,6 +15,8 @@ this.count = new Integer(args[++i]); } else if ("-size".equals(args[i])) { this.size = new Integer(args[++i]); + } else if ("-nodeNum".equals(args[i])) { + this.nodeNum = new Integer(args[++i]); } } }