Mercurial > hg > Database > Alice
changeset 62:ead04b496305
change print relay count to node num on ring
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 09 Feb 2012 17:53:24 +0900 |
parents | 84cfcc8e1bce |
children | 498d1d2524d3 |
files | src/alice/test/topology/ring/CheckMyName.java src/alice/test/topology/ring/FirstRingMessagePassing.java src/alice/test/topology/ring/RingTopologyConfig.java |
diffstat | 3 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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");
--- 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"); }
--- 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]); } } }