incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hama Wiki] Update of "PiEstimator" by edwardyoon
Date Tue, 15 Feb 2011 23:56:44 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hama Wiki" for change notification.

The "PiEstimator" page has been changed by edwardyoon.
http://wiki.apache.org/hama/PiEstimator?action=diff&rev1=10&rev2=11

--------------------------------------------------

        bspPeer.send(masterTask, estimate);
        bspPeer.sync();
  
-       double pi = 0.0;
-       int numPeers = bspPeer.getNumCurrentMessages();
-       BSPMessage received;
-       while ((received = bspPeer.getCurrentMessage()) != null) {
-         pi += Bytes.toDouble(received.getData());
-       }
  
        if (bspPeer.getPeerName().equals(masterTask)) {
+         double pi = 0.0;
+         int numPeers = bspPeer.getNumCurrentMessages();
+         BSPMessage received;
+         while ((received = bspPeer.getCurrentMessage()) != null) {
+           pi += Bytes.toDouble(received.getData());
+         }
+ 
          pi = pi / numPeers;
          writeResult(pi);
        }

Mime
View raw message