Mercurial > hg > Members > tatsuki > Alice
changeset 168:f846527a98b7 working
minor change
author | sugi |
---|---|
date | Sat, 15 Dec 2012 14:37:56 +0900 |
parents | a55acaea1eb1 |
children | 16418c2c3e72 |
files | src/alice/test/codesegment/local/bitonicsort/SetTask.java src/alice/test/codesegment/local/bitonicsort/ShowData.java src/alice/test/codesegment/local/bitonicsort/SortConfig.java |
diffstat | 3 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/alice/test/codesegment/local/bitonicsort/SetTask.java Sat Dec 15 12:45:27 2012 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/SetTask.java Sat Dec 15 14:37:56 2012 +0900 @@ -28,6 +28,9 @@ int last_block_num = conf.getLength() - (conf.getSplitNum() - 1)*block_num; ods.put("local", "last_block_num", last_block_num); + System.out.println("sort start"); + t = System.currentTimeMillis(); + { String key = "array"; int i = 0; @@ -41,13 +44,13 @@ ods.put("local", "range"+i, new RangeInfo(i,true)); ods.update("local", key+i, list.createDataList(i*block_num, last_block_num)); ods.update("local", "count"+i, 0); - ods.put("local","arraynum",i); + ods.put("local","arraynum",i+1); new OddPhase("range"+i,key+i,0,"count"+i); - new ShowData(i); + new ShowData(i+1); } - System.out.println("sort start"); - t = System.currentTimeMillis(); + + } }
--- a/src/alice/test/codesegment/local/bitonicsort/ShowData.java Sat Dec 15 12:45:27 2012 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/ShowData.java Sat Dec 15 14:37:56 2012 +0900 @@ -13,10 +13,10 @@ private Receiver info0 = ids.create(CommandType.PEEK); public ShowData(int cnt) { - info = new Receiver[cnt+1]; - for (int i= 0;i<= cnt; i++) + info = new Receiver[cnt]; + for (int i= 0;i < cnt; i++) info[i] = ids.create(CommandType.PEEK); - for (int i= 0;i<= cnt; i++) + for (int i= 0;i < cnt; i++) info[i].setKey("local","array"+i,1); info0.setKey("local", "arraynum"); } @@ -26,7 +26,7 @@ System.out.println(System.currentTimeMillis() -SetTask.t +" ms"); int cnt = info0.asInteger(); List<Integer> list = new ArrayList<Integer>(); - for (int i= 0;i<= cnt; i++){ + for (int i= 0;i < cnt; i++){ list.addAll(info[i].asClass(DataList.class).table); } System.out.println("size check :"+ list.size());
--- a/src/alice/test/codesegment/local/bitonicsort/SortConfig.java Sat Dec 15 12:45:27 2012 +0900 +++ b/src/alice/test/codesegment/local/bitonicsort/SortConfig.java Sat Dec 15 14:37:56 2012 +0900 @@ -18,6 +18,7 @@ MAX_BLOCK_SIZE = Integer.parseInt(args[++i]); } } + if (length<MAX_BLOCK_SIZE) MAX_BLOCK_SIZE = length; } public int getLength() {