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] Trivial Update of "PiEstimator" by edwardyoon
Date Mon, 25 Oct 2010 01:23: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.
The comment on this change is: BSPPeer interface changed..
http://wiki.apache.org/hama/PiEstimator?action=diff&rev1=6&rev2=7

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

          }
        }
  
-       byte[] tagName = Bytes.toBytes(getName().toString());
+       byte[] tagName = Bytes.toBytes(bspPeer.getPeerName());
        byte[] myData = Bytes.toBytes(4.0 * (double) in / (double) iterations);
        BSPMessage estimate = new BSPMessage(tagName, myData);
  
-       bspPeer.send(bspPeer.getAddress(masterTask), estimate);
+       bspPeer.send(masterTask, estimate);
        bspPeer.sync();
  
        double pi = 0.0;
@@ -97, +97 @@

        IOException {
      // BSP job configuration
      HamaConfiguration conf = new HamaConfiguration();
-    
+     // Execute locally
+     // conf.set("bsp.master.address", "local");
+ 
      BSPJob bsp = new BSPJob(conf, PiEstimator.class);
      // Set the job name
      bsp.setJobName("pi estimation example");
@@ -106, +108 @@

      BSPJobClient jobClient = new BSPJobClient(conf);
      ClusterStatus cluster = jobClient.getClusterStatus(true);
      // Choose one as a master
-     for (String name : cluster.getActiveGroomNames()) {
+     for (String peerName : cluster.getActiveGroomNames().values()) {
-       conf.set(MASTER_TASK, name);
+       conf.set(MASTER_TASK, peerName);
        break;
      }
  

Mime
View raw message