Mercurial > hg > Members > tatsuki > Alice
view src/main/java/alice/test/codesegment/local/bitonicsort/SortConfig.java @ 402:dbfeb353a78d draft multicast tip
refs #3 test commit
author | tatsuki |
---|---|
date | Tue, 24 Jun 2014 19:06:41 +0900 |
parents | 8f71c3e6f11d |
children |
line wrap: on
line source
package alice.test.codesegment.local.bitonicsort; import org.msgpack.annotation.Message; @Message public class SortConfig { public int length = 1200; public int MAX_BLOCK_SIZE = 1024; public int cpu = 1; public SortConfig(){} public SortConfig(String[] args){ for (int i=0;i<args.length; i++){ if ("-l".equals(args[i])){ length = Integer.parseInt(args[++i]); } else if ("-b".equals(args[i])){ MAX_BLOCK_SIZE = Integer.parseInt(args[++i]); } } if (length<MAX_BLOCK_SIZE) MAX_BLOCK_SIZE = length; } public int getLength() { return length; } public int getblockSize() { return MAX_BLOCK_SIZE; } public int getSplitNum(){ if (length / cpu < MAX_BLOCK_SIZE){ return cpu; } else { return (length + MAX_BLOCK_SIZE -1) / MAX_BLOCK_SIZE; } } }