private int assignThreads(int splitIndex,int splitCount){
  if (threadsPerSplit > 0) {
    return threadsPerSplit;
  }
  if (splitCount == 1) {
    return threadCount;
  }
  if (splitCount * minThreads > threadCount) {
    return minThreads;
  }
  if (splitIndex % threadCount < threadCount % splitCount) {
    return threadCount / splitCount + 1;
  }
 else {
    return threadCount / splitCount;
  }
}

private int assignThreads ( int splitIndex , int splitCount ) { if ( threadsPerSplit > 0 ) { return threadsPerSplit ; } if ( splitCount == 1 ) { return threadCount ; } if ( splitCount * minThreads > threadCount ) { return minThreads ; } if ( splitIndex % threadCount < threadCount % splitCount ) { return threadCount / splitCount + 1 ; } else { return threadCount / splitCount ; } }
assign thread count for a given split
