Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1110#discussion_r15508571
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala 
---
    @@ -104,13 +105,11 @@ class RowMatrix(
         val nt: Int = n * (n + 1) / 2
     
         // Compute the upper triangular part of the gram matrix.
    -    val GU = rows.aggregate(new BDV[Double](new Array[Double](nt)))(
    +    val GU = rows.treeAggregate(new BDV[Double](new Array[Double](nt)))(
           seqOp = (U, v) => {
             RowMatrix.dspr(1.0, v, U.data)
             U
    -      },
    -      combOp = (U1, U2) => U1 += U2
    -    )
    +      }, combOp = (U1, U2) => U1 += U2, depth = 2)
    --- End diff --
    
    maybe you can set depth to be 2 by default so you don't need to repeat this 
...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to