changeset 196:caee170e6cfa working

use no convert put/update method
author e095732
date Tue, 12 Mar 2013 13:49:48 +0900
parents b4ca7f75e6b2
children 2b28d3c16a58
files src/alice/test/codesegment/local/StartCodeSegment.java src/alice/test/codesegment/local/TestCodeSegment.java src/alice/test/codesegment/local/bitonicsort/EvenPhase.java src/alice/test/codesegment/local/bitonicsort/MakeData.java src/alice/test/codesegment/local/bitonicsort/OddPhase.java src/alice/test/codesegment/local/bitonicsort/SetTask.java src/alice/test/codesegment/local/mergesort/MergeArray.java src/alice/test/codesegment/local/mergesort/SeparateArray.java src/alice/test/codesegment/local/mergesort/SortStart.java
diffstat 9 files changed, 35 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/src/alice/test/codesegment/local/StartCodeSegment.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/StartCodeSegment.java	Tue Mar 12 13:49:48 2013 +0900
@@ -21,13 +21,13 @@
 										 // this startup TestCodeSegment.  
 		*/
 		DataList list = new DataList();
-		int size = 10;
+		int size = 10000;
 		for (int i = 0; i < size; i++){
 			Random rnd = new Random();
 			list.table.add(rnd.nextInt(100000));
 		}
 		t = System.currentTimeMillis();
-		ods.put("key1", list);
+		ods.put("local","key1", list);
 		//ods.put("local", "key1", 1);
 		//ods.put("local", "key1", 2);
 		//ods.put("local", "key1", 3);
--- a/src/alice/test/codesegment/local/TestCodeSegment.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/TestCodeSegment.java	Tue Mar 12 13:49:48 2013 +0900
@@ -3,12 +3,11 @@
 import alice.codesegment.CodeSegment;
 import alice.datasegment.CommandType;
 import alice.datasegment.Receiver;
-import alice.test.codesegment.local.bitonicsort.DataList;
 
 public class TestCodeSegment extends CodeSegment {
 	
 	static int count = 0;
-	
+	static long y =0;
 	// create input datasegment arg1
 	Receiver arg1 = ids.create(CommandType.PEEK);
 	public TestCodeSegment(){
@@ -20,15 +19,19 @@
 	
 	@Override
 	public void run() {
-		if(count > 0){
+		if(count > 100000){
 			System.out.println(System.currentTimeMillis() - StartCodeSegment.t);
+			//System.out.println(TestCodeSegment.y );
 			System.exit(1);
 		}
-		DataList list = (DataList)arg1.obj;
-		System.out.println("ssss"+list.table);
+		//DataList list = arg1.asClass(DataList.class);
+		//System.out.println(list.table);
 		//System.out.println(arg1.val);
+		//long u = System.currentTimeMillis();
+		//int i = arg1.asInteger()+1;
+		//TestCodeSegment.y +=( System.currentTimeMillis() - u); 
+		ods.update("local", "key1", arg1.val);
 		
-		//ods.update("key1",arg1.asInteger()+1);
 		new TestCodeSegment();
 		
 		//new TestCodeSegment(arg1.index);
--- a/src/alice/test/codesegment/local/bitonicsort/EvenPhase.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/bitonicsort/EvenPhase.java	Tue Mar 12 13:49:48 2013 +0900
@@ -44,11 +44,11 @@
 		if (info2==null){
 			DataList list = (DataList)info1.obj;
 			if (count > sort_count){
-				ods.update("array"+info.range, list);
+				ods.update("array"+info.range, list ,false);
 				return;
 			}
 			ods.put(info.range+"f", "dummy");
-			ods.put(info.range+"b", list);
+			ods.put(info.range+"b", list, false);
 			//System.out.println("next Odd "+info.range+" "+info.range+"b"+" "+(info.range+1)+"f");
 			new OddPhase(info0.key,info.range+"b",(info.range+1)+"f",count,info6.key);
 		} else {
@@ -60,20 +60,20 @@
 			list3.table.addAll(list2.table);
 			
 			if (count > sort_count){
-				ods.update("array"+info.range, list3);
+				ods.update("array"+info.range, list3 ,false);
 				return;
 			}
 			int block_num = info3.asInteger();
 			Sort.quickSort(list3.table, 0, list3.table.size()-1);
 			if (!info.lastFlag){
-				ods.put(info.range+"f",	list3.createDataList(0, block_num/2));
-				ods.put(info.range+"b",	list3.createDataList(block_num/2, block_num/2));
+				ods.put(info.range+"f",	list3.createDataList(0, block_num/2) ,false);
+				ods.put(info.range+"b",	list3.createDataList(block_num/2, block_num/2),false);
 				//System.out.println("next Odd "+info.range+" "+ info.range+"b"+" "+(info.range+1)+"f");
 				new OddPhase(info0.key,info.range+"b",(info.range+1)+"f",count,info6.key);
 			} else {
 				int last_block_num = info4.asInteger();
-				ods.put(info.range+"f", list3.createDataList(0, block_num/2));
-				ods.put(info.range+"b", list3.createDataList(block_num/2, last_block_num));
+				ods.put(info.range+"f", list3.createDataList(0, block_num/2) ,false);
+				ods.put(info.range+"b", list3.createDataList(block_num/2, last_block_num) ,false);
 				//System.out.println("next Odd "+info.range+" "+ info.range+"b");
 				new OddPhase(info0.key ,info.range+"b",count,info6.key);
 			}
--- a/src/alice/test/codesegment/local/bitonicsort/MakeData.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/bitonicsort/MakeData.java	Tue Mar 12 13:49:48 2013 +0900
@@ -26,6 +26,6 @@
 			list.table.add(rnd.nextInt(100000));
 		}
 		
-		ods.update("list", list);
+		ods.update("list", list, false);
 	}
 }
--- a/src/alice/test/codesegment/local/bitonicsort/OddPhase.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/bitonicsort/OddPhase.java	Tue Mar 12 13:49:48 2013 +0900
@@ -43,13 +43,13 @@
 		if (info2==null){
 			DataList list = (DataList)info1.obj;
 			if (count > sort_count){
-				ods.update("array"+info.range, list);
+				ods.update("array"+info.range, list, false);
 				return;
 			}
 			Sort.quickSort(list.table,0,list.table.size()-1);
 			if (!info.lastFlag){ 
-				ods.put(info.range+"f", list.createDataList(0, block_num/2));
-				ods.put(info.range+"b", list.createDataList(block_num/2, block_num/2));
+				ods.put(info.range+"f", list.createDataList(0, block_num/2) ,false);
+				ods.put(info.range+"b", list.createDataList(block_num/2, block_num/2) ,false);
 				
 				if (info.range==0){
 					//System.out.println("next Even "+info.range+" "+info.range+"f");	
@@ -59,7 +59,7 @@
 					new EvenPhase(info0.key,(info.range-1)+"b",info.range+"f",count,info6.key);
 				}
 			} else {
-				ods.put(info.range+"f",list);
+				ods.put(info.range+"f",list, false);
 				ods.put(info.range+"b","dummy");
 				//System.out.println("next Even "+info.range+" "+ (info.range-1)+"b"+" "+(info.range)+"f");
 				new EvenPhase(info0.key,(info.range-1)+"b",info.range+"f",count,info6.key);
@@ -73,13 +73,13 @@
 			list3.table.addAll(list1.table);
 			list3.table.addAll(list2.table);
 			if (count > sort_count){
-				ods.update("array"+info.range, list3);
+				ods.update("array"+info.range, list3, false);
 				return;
 			}
 
 			Sort.quickSort(list3.table,0,list3.table.size()-1);
-			ods.put(info.range+"f", list3.createDataList(0, block_num/2));
-			ods.put(info.range+"b", list3.createDataList(block_num/2, block_num/2));
+			ods.put(info.range+"f", list3.createDataList(0, block_num/2) ,false);
+			ods.put(info.range+"b", list3.createDataList(block_num/2, block_num/2) ,false);
 
 			if (info.range==0){
 				//System.out.println("next Even2b "+info.range+" "+ info.range+"f");
--- a/src/alice/test/codesegment/local/bitonicsort/SetTask.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/bitonicsort/SetTask.java	Tue Mar 12 13:49:48 2013 +0900
@@ -36,13 +36,13 @@
 			int i = 0;
 			for (i = 0;i< conf.getSplitNum()-1; i++){
 				ods.put("local", "range"+i, new RangeInfo(i,false));
-				ods.update(key+i, list.createDataList(i*block_num, block_num));
+				ods.update(key+i, list.createDataList(i*block_num, block_num) ,false);
 				ods.update("local", "count"+i, 0);
 				new OddPhase("range"+i,key+i,0,"count"+i);
 			}
 			
 			ods.put("local", "range"+i, new RangeInfo(i,true));
-			ods.update(key+i, list.createDataList(i*block_num, last_block_num));
+			ods.update(key+i, list.createDataList(i*block_num, last_block_num) ,false);
 			ods.update("local", "count"+i, 0);
 			ods.put("local","arraynum",i+1);
 			new OddPhase("range"+i,key+i,0,"count"+i);
--- a/src/alice/test/codesegment/local/mergesort/MergeArray.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/mergesort/MergeArray.java	Tue Mar 12 13:49:48 2013 +0900
@@ -72,6 +72,6 @@
 		int num = (keyNum1-1)/2;
 		String key = Integer.toString(num);
 		
-		ods.put(key, list3);
+		ods.put(key, list3, false);
 	}
 }
--- a/src/alice/test/codesegment/local/mergesort/SeparateArray.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/mergesort/SeparateArray.java	Tue Mar 12 13:49:48 2013 +0900
@@ -26,8 +26,8 @@
 			String key1 = Integer.toString(num);
 			String key2 = Integer.toString(num+1);
 
-			ods.put(key1, list.createDataList(0, length));
-			ods.put(key2, list.createDataList(length, length));			
+			ods.put(key1, list.createDataList(0, length), false);
+			ods.put(key2, list.createDataList(length, length),false);			
 			
 			new SeparateArray(num);
 			new SeparateArray(num+1);
@@ -36,14 +36,14 @@
 			String key = Integer.toString(keyNum);
 			
 			if (list.table.get(0)<=list.table.get(1)){
-				ods.put(key, list);
+				ods.put(key, list, false);
 			} else {
 				Sort.swap(list.table, 0, 1);
-				ods.put(key, list);
+				ods.put(key, list,false);
 			}
 		} else {
 			String key = Integer.toString(keyNum);
-			ods.put(key, list);
+			ods.put(key, list, false);
 		}
 	}
 
--- a/src/alice/test/codesegment/local/mergesort/SortStart.java	Tue Mar 12 00:49:19 2013 +0900
+++ b/src/alice/test/codesegment/local/mergesort/SortStart.java	Tue Mar 12 13:49:48 2013 +0900
@@ -22,7 +22,7 @@
 		}
 		
 		String key = Integer.toString(0);
-		ods.put(key, list);
+		ods.put(key, list, false);
 	
 		new SeparateArray(0);
 		new ShowResult(0);