You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hama.apache.org by "Edward J. Yoon" <ed...@apache.org> on 2015/02/23 10:48:32 UTC

Small quick patch

The finishVertexComputation() method should be called only after
compute() is called.


Index: graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
===================================================================
--- graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
(revision 1660064)
+++ graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
(working copy)
@@ -241,6 +241,7 @@
       final byte[] serializedMsgs = currentMessage.getValuesBytes();
       msgs = getIterableMessages(numOfValues, serializedMsgs);

+      // reactivation
       if (vertex.isHalted()) {
         vertex.setActive();
       }
@@ -247,12 +248,13 @@

       if (!vertex.isHalted()) {
         vertex.compute((Iterable<M>) msgs);
+        vertices.finishVertexComputation(vertex);
+        activeVertices++;
+
         notComputedVertices.remove(vertex.getVertexID());
-        activeVertices++;
       }

       currentMessage = peer.getCurrentMessage();
-      vertices.finishVertexComputation(vertex);
     }

     for (V v : notComputedVertices) {


-- 
Best Regards, Edward J. Yoon

Re: Small quick patch

Posted by Andronidis Anastasios <an...@hotmail.com>.
+1

On 23 Φεβ 2015, at 10:48 π.μ., Edward J. Yoon <ed...@apache.org> wrote:

> The finishVertexComputation() method should be called only after
> compute() is called.
> 
> 
> Index: graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
> ===================================================================
> --- graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
> (revision 1660064)
> +++ graph/src/main/java/org/apache/hama/graph/GraphJobRunner.java
> (working copy)
> @@ -241,6 +241,7 @@
>       final byte[] serializedMsgs = currentMessage.getValuesBytes();
>       msgs = getIterableMessages(numOfValues, serializedMsgs);
> 
> +      // reactivation
>       if (vertex.isHalted()) {
>         vertex.setActive();
>       }
> @@ -247,12 +248,13 @@
> 
>       if (!vertex.isHalted()) {
>         vertex.compute((Iterable<M>) msgs);
> +        vertices.finishVertexComputation(vertex);
> +        activeVertices++;
> +
>         notComputedVertices.remove(vertex.getVertexID());
> -        activeVertices++;
>       }
> 
>       currentMessage = peer.getCurrentMessage();
> -      vertices.finishVertexComputation(vertex);
>     }
> 
>     for (V v : notComputedVertices) {
> 
> 
> -- 
> Best Regards, Edward J. Yoon