hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomm...@apache.org
Subject svn commit: r1404120 - /hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
Date Wed, 31 Oct 2012 13:01:30 GMT
Author: tommaso
Date: Wed Oct 31 13:01:30 2012
New Revision: 1404120

URL: http://svn.apache.org/viewvc?rev=1404120&view=rev
Log:
[HAMA-661] - avoiding erroneous sending thetaDeltas messages to oneself

Modified:
    hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java

Modified: hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java
URL: http://svn.apache.org/viewvc/hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java?rev=1404120&r1=1404119&r2=1404120&view=diff
==============================================================================
--- hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java (original)
+++ hama/trunk/ml/src/main/java/org/apache/hama/ml/regression/GradientDescentBSP.java Wed
Oct 31 13:01:30 2012
@@ -158,7 +158,9 @@ public class GradientDescentBSP extends 
 
       // send thetaDelta to the each peer
       for (String peerName : peer.getAllPeerNames()) {
-        peer.send(peerName, new VectorWritable(new DenseDoubleVector(thetaDelta)));
+        if (!peerName.equals(peer.getPeerName())) { // avoid sending to oneself
+          peer.send(peerName, new VectorWritable(new DenseDoubleVector(thetaDelta)));
+        }
       }
 
       peer.sync();



Mime
View raw message