# HG changeset patch # User one # Date 1364374568 -32400 # Node ID 3f20b640182377b073883ca35c02df234e7ba624 # Parent b5daccf361046a442a33057a77c396c908998678 remove error form bitonic diff -r b5daccf36104 -r 3f20b6401823 src/alice/codesegment/OutputDataSegment.java --- a/src/alice/codesegment/OutputDataSegment.java Wed Mar 27 17:30:52 2013 +0900 +++ b/src/alice/codesegment/OutputDataSegment.java Wed Mar 27 17:56:08 2013 +0900 @@ -35,9 +35,7 @@ } public void flip(Receiver receiver) { - //DataSegment.getLocal().put(receiver.key, receiver.val,receiver.obj); - DataSegmentKey key = DataSegment.getLocal().getDataSegmentKey(receiver.data.key); - key.runCommand(new Command(CommandType.PUT,null,null, receiver.data.val,receiver.data.obj, 0,0,null,null, "local")); + DataSegment.getLocal().put(receiver.key, receiver.data.getObject()); } public void put(String key, Value val) { diff -r b5daccf36104 -r 3f20b6401823 src/alice/codesegment/ReceiveLocalData.java --- a/src/alice/codesegment/ReceiveLocalData.java Wed Mar 27 17:30:52 2013 +0900 +++ b/src/alice/codesegment/ReceiveLocalData.java Wed Mar 27 17:56:08 2013 +0900 @@ -32,4 +32,9 @@ return (T) obj; } + + @Override + public Object getVal() { + return obj; + } } diff -r b5daccf36104 -r 3f20b6401823 src/alice/datasegment/ReceiveRemoteData.java --- a/src/alice/datasegment/ReceiveRemoteData.java Wed Mar 27 17:30:52 2013 +0900 +++ b/src/alice/datasegment/ReceiveRemoteData.java Wed Mar 27 17:56:08 2013 +0900 @@ -55,6 +55,10 @@ return null; } - + + @Override + public Object getVal() { + return val; + } } \ No newline at end of file diff -r b5daccf36104 -r 3f20b6401823 src/alice/datasegment/Receiver.java --- a/src/alice/datasegment/Receiver.java Wed Mar 27 17:30:52 2013 +0900 +++ b/src/alice/datasegment/Receiver.java Wed Mar 27 17:56:08 2013 +0900 @@ -1,7 +1,11 @@ package alice.datasegment; +import java.io.IOException; + import alice.codesegment.InputDataSegment; +import alice.codesegment.SingletonMessage; +import alice.test.codesegment.local.bitonicsort.SortConfig; /** * MessagePack implementation and DataSegment Receiver @@ -67,5 +71,17 @@ data = r; } + + public Object getVal() { + return data.getVal(); + } + + public T asClass(Receiver receiver, Class clazz) { + return data.asClass(receiver, clazz); + } + + public int asInteger(Receiver receiver) { + return data.asInteger(receiver); + } } diff -r b5daccf36104 -r 3f20b6401823 src/alice/datasegment/ReceiverData.java --- a/src/alice/datasegment/ReceiverData.java Wed Mar 27 17:30:52 2013 +0900 +++ b/src/alice/datasegment/ReceiverData.java Wed Mar 27 17:56:08 2013 +0900 @@ -1,5 +1,14 @@ package alice.datasegment; +import org.msgpack.type.ArrayValue; + public interface ReceiverData { + public String asString(Receiver receiver); + public int asInteger(Receiver receiver); + public Float asFloat(Receiver receiver) ; + public ArrayValue asArray(Receiver receiver); + public T asClass(Receiver receiver, Class clazz); + public Object getVal(); + } \ No newline at end of file diff -r b5daccf36104 -r 3f20b6401823 src/alice/test/codesegment/local/TestCodeSegment.java --- a/src/alice/test/codesegment/local/TestCodeSegment.java Wed Mar 27 17:30:52 2013 +0900 +++ b/src/alice/test/codesegment/local/TestCodeSegment.java Wed Mar 27 17:56:08 2013 +0900 @@ -3,6 +3,7 @@ import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; +import org.msgpack.type.Value; public class TestCodeSegment extends CodeSegment { @@ -11,17 +12,17 @@ @Override public void run() { - System.out.println("index = " + arg1.data.index); - System.out.println("data = " + arg1.data.val); - System.out.println(arg1.data.val.getType()); + System.out.println("index = " + arg1.index); + System.out.println("data = " + arg1.getVal()); + System.out.println(((Value)arg1.getVal()).getType()); - if (arg1.data.index == 10) { + if (arg1.index == 10) { System.exit(0); return; } TestCodeSegment cs = new TestCodeSegment(); - cs.arg1.setKey("key1", arg1.data.index); + cs.arg1.setKey("key1", arg1.index); // DataSegment.get("local").update ods.update("local", "key1", "String data"); diff -r b5daccf36104 -r 3f20b6401823 src/alice/test/codesegment/local/bitonicsort/MakeData.java --- a/src/alice/test/codesegment/local/bitonicsort/MakeData.java Wed Mar 27 17:30:52 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/MakeData.java Wed Mar 27 17:56:08 2013 +0900 @@ -19,8 +19,8 @@ @Override public void run() { // This conversion over head should be remove. - SortConfig conf = info1.data.asClass(info1, SortConfig.class); - DataList list = (DataList)info2.data.obj; + SortConfig conf = info1.asClass(info1, SortConfig.class); + DataList list = info2.asClass(info2, DataList.class); int size = conf.getLength(); Random rnd = new Random(); for (int i = 0; i < size; i++){ diff -r b5daccf36104 -r 3f20b6401823 src/alice/test/codesegment/local/bitonicsort/OddPhase.java --- a/src/alice/test/codesegment/local/bitonicsort/OddPhase.java Wed Mar 27 17:30:52 2013 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/OddPhase.java Wed Mar 27 17:56:08 2013 +0900 @@ -27,16 +27,15 @@ @Override public void run() { - RangeInfo info = info0.data.asClass(info0, RangeInfo.class); - int sort_count = info5.data.asInteger(info5); - int count = info6.data.asInteger(info6); + RangeInfo info = info0.asClass(info0, RangeInfo.class); + int sort_count = info5.asInteger(info5); + int count = info6.asInteger(info6); //System.out.println("count is " +count); int i = info.range; if (count