Skip to content

Commit

Permalink
Fix termination bug caused by in-degree zero mirrors
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Poremba committed Dec 3, 2021
1 parent b46a2a0 commit aefaa7b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/scala/com/cluster/graph/entity/MirrorEntity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class MirrorEntity(
case ApplyResult(stepNum, oldVal, newVal) => {
ctxLog("Received apply value from Main " + newVal)
localScatter(stepNum, oldVal, newVal, sharding)
// If no incoming edges, then need to send a message to Main for the next superstep
if(this.partitionInDegree == 0) {
val cmd = MirrorTotal(stepNum + 1, None)
val mainRef = sharding.entityRefFor(VertexEntity.TypeKey, main.toString())
mainRef ! cmd
}
Behaviors.same
}

Expand Down

0 comments on commit aefaa7b

Please sign in to comment.