incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1021983 - /incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java
Date Wed, 13 Oct 2010 03:27:32 GMT
Author: edwardyoon
Date: Wed Oct 13 03:27:32 2010
New Revision: 1021983

URL: http://svn.apache.org/viewvc?rev=1021983&view=rev
Log:
Trivial change: I just removed hardcoded number of task.

Modified:
    incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java

Modified: incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java?rev=1021983&r1=1021982&r2=1021983&view=diff
==============================================================================
--- incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java (original)
+++ incubator/hama/trunk/src/examples/org/apache/hama/examples/PiEstimator.java Wed Oct 13
03:27:32 2010
@@ -65,7 +65,7 @@ public class PiEstimator {
       BSPMessage received;
       while ((received = bspPeer.getCurrentMessage()) != null) {
         LOG.info("Receives messages:" + Bytes.toDouble(received.getData()));
-        pi = (pi + Bytes.toDouble(received.getData())) / 2;
+        pi = (pi + Bytes.toDouble(received.getData())) / bspPeer.getAllPeers().size();
       }
 
       if (pi != 0.0) {



Mime
View raw message