coderzc commented on code in PR #237:
URL:
https://github.com/apache/incubator-hugegraph-computer/pull/237#discussion_r1199109841
##########
computer-core/src/main/java/org/apache/hugegraph/computer/core/master/MasterService.java:
##########
@@ -335,9 +335,7 @@ private boolean finishedIteration(boolean masterContinue,
if (context.superstep() >= this.maxSuperStep - 1) {
return true;
}
- long activeVertexCount = context.totalVertexCount() -
- context.finishedVertexCount();
- return context.messageCount() == 0L && activeVertexCount == 0L;
+ return false;
Review Comment:
@JackyYangPassion
I checked the code again. There is no problem using messageCount, because
this messageCount is sendMessageCount, root case is
`org.apache.hugegraph.computer.core.sender.MessageSendManager#messageStat` only
can get stat of current thread.
https://github.com/apache/incubator-hugegraph-computer/blob/3328d5232ab944143d60fc4dc946d566550fa6e8/computer-core/src/main/java/org/apache/hugegraph/computer/core/sender/MessageSendManager.java#L173-L175
https://github.com/apache/incubator-hugegraph-computer/blob/3328d5232ab944143d60fc4dc946d566550fa6e8/computer-core/src/main/java/org/apache/hugegraph/computer/core/sender/MessageSendBuffers.java#L55-L60
So I think we should add method
`org.apache.hugegraph.computer.core.sender.MessageSendBuffers#messageStat`:
```java
public MessageStat messageStat(int partitionId) {
if (partitionId < 0 || partitionId >= this.buffers.length) {
throw new ComputerException("Invalid partition id %s",
partitionId);
}
return this.buffers[partitionId].messageWritten();
}
```
And use `this.buffers.messageStat(partitionId)` instead of
`this.buffers.get(partitionId).messageWritten()` in the
`org.apache.hugegraph.computer.core.sender.MessageSendManager#messageStat`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]