Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit b983d49

Browse files
piganeshsrowen
authored andcommitted
[SPARK-8695] [CORE] [MLLIB] TreeAggregation shouldn't be triggered when it doesn't save wall-clock time.
Author: Perinkulam I. Ganesh <[email protected]> Closes apache#7397 from piganesh/SPARK-8695 and squashes the following commits: 041620c [Perinkulam I. Ganesh] [SPARK-8695][CORE][MLlib] TreeAggregation shouldn't be triggered when it doesn't save wall-clock time. 9ad067c [Perinkulam I. Ganesh] [SPARK-8695] [core] [WIP] TreeAggregation shouldn't be triggered for 5 partitions a6fed07 [Perinkulam I. Ganesh] [SPARK-8695] [core] [WIP] TreeAggregation shouldn't be triggered for 5 partitions
1 parent 6d0d8b4 commit b983d49

File tree

1 file changed

+3
-1
lines changed
  • core/src/main/scala/org/apache/spark/rdd

1 file changed

+3
-1
lines changed

core/src/main/scala/org/apache/spark/rdd/RDD.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,9 @@ abstract class RDD[T: ClassTag](
10821082
val scale = math.max(math.ceil(math.pow(numPartitions, 1.0 / depth)).toInt, 2)
10831083
// If creating an extra level doesn't help reduce
10841084
// the wall-clock time, we stop tree aggregation.
1085-
while (numPartitions > scale + numPartitions / scale) {
1085+
1086+
// Don't trigger TreeAggregation when it doesn't save wall-clock time
1087+
while (numPartitions > scale + math.ceil(numPartitions.toDouble / scale)) {
10861088
numPartitions /= scale
10871089
val curNumPartitions = numPartitions
10881090
partiallyAggregated = partiallyAggregated.mapPartitionsWithIndex {

0 commit comments

Comments
 (0)