Mercurial > hg > Database > Alice
view src/main/java/alice/test/topology/ring/FirstRingMessagePassing.java @ 466:268b1280dc18 dispose
remove debug message
author | sugi |
---|---|
date | Sat, 15 Nov 2014 04:48:35 +0900 |
parents | aefbe41fcf12 |
children | 15eeb439830c |
line wrap: on
line source
package alice.test.topology.ring; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; public class FirstRingMessagePassing extends CodeSegment { public Receiver ds1 = ids.create(CommandType.TAKE); private long startTime; private int count; private int nodeNum; public FirstRingMessagePassing(long startTime, int count, int nodeNum) { this.startTime = startTime; this.count = count; this.nodeNum = nodeNum; } public FirstRingMessagePassing(int count, int nodeNum) { // at first this.startTime = System.nanoTime(); this.count = count; this.nodeNum = nodeNum; } @Override public void run() { ods.put("right", "c", ds1.getReceiveData()); // copy whole DataSegment to the right if (ds1.index > count) { // after count time update of ds1 ods.put("right", "finish", ValueFactory.createNilValue()); long endTime = System.nanoTime(); long time = endTime - startTime; System.out.println(nodeNum + " " + time / count / 1000000.0); return; } FirstRingMessagePassing cs = new FirstRingMessagePassing(startTime, count, nodeNum); cs.ds1.setKey("c"); } }