Skip to content

Commit

Permalink
minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
jegonzal committed Oct 30, 2014
1 parent 6b5100a commit 57b7de9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions graphx/src/main/scala/org/apache/spark/graphx/Pregel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ object Pregel extends Logging {
sendMsg(simpleTriplet, ctx)
}

// Compute the messages for all the active vertices
val messages = g.mapReduceTriplets(sendMessageWrapper, mergeMsg, Some((activeVertices, activeDirection)))

// get a reference to the current graph so that we can unpersist it once the new graph is created.
val prevG = g

// Compute the messages for all the active vertices
val messages = g.mapReduceTriplets(sendMessageWrapper, mergeMsg, Some((activeVertices, activeDirection)))

// Receive the messages to the subset of active vertices
g = g.outerJoinVertices(messages){ (vid, dataAndActive, msgOpt) =>
val (vdata, active) = dataAndActive
Expand All @@ -276,11 +276,11 @@ object Pregel extends Logging {
numActive = activeVertices.count()

// Unpersist the RDDs hidden by newly-materialized RDDs
// prevG.unpersistVertices(blocking=false)
// prevG.edges.unpersist(blocking=false)
//prevG.unpersistVertices(blocking=false)
//prevG.edges.unpersist(blocking=false)

println("Finished Iteration " + i)
g.vertices.foreach(println(_))
//println("Finished Iteration " + i)
// g.vertices.foreach(println(_))

logInfo("Pregel finished iteration " + i)
// count the iteration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class PageRankSuite extends FunSuite with LocalSparkContext with Matchers {
a.leftJoin(b) { case (id, a, bOpt) => (a - bOpt.getOrElse(0.0)) * (a - bOpt.getOrElse(0.0)) }
.map { case (id, error) => error }.sum
}

/*
test("Static Star PageRank") {
withSpark { sc =>
Expand Down Expand Up @@ -137,7 +137,7 @@ class PageRankSuite extends FunSuite with LocalSparkContext with Matchers {
}
}
}

*/

test("Grid Static PageRank") {
withSpark { sc =>
Expand All @@ -157,7 +157,7 @@ class PageRankSuite extends FunSuite with LocalSparkContext with Matchers {
}
} // end of Grid PageRank


/*
test("Grid Dynamic PageRank") {
withSpark { sc =>
val rows = 5
Expand All @@ -176,6 +176,6 @@ class PageRankSuite extends FunSuite with LocalSparkContext with Matchers {
}
}
} // end of Grid PageRank

*/

}

0 comments on commit 57b7de9

Please sign in to comment.