You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2010/11/11 13:18:34 UTC

svn commit: r1033910 - in /incubator/hama/trunk: CHANGES.txt src/examples/org/apache/hama/examples/PiEstimator.java

Author: edwardyoon
Date: Thu Nov 11 12:18:34 2010
New Revision: 1033910

URL: http://svn.apache.org/viewvc?rev=1033910&view=rev
Log:
Add taskNum argument to pi estimator

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

Modified: incubator/hama/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/CHANGES.txt?rev=1033910&r1=1033909&r2=1033910&view=diff
==============================================================================
--- incubator/hama/trunk/CHANGES.txt (original)
+++ incubator/hama/trunk/CHANGES.txt Thu Nov 11 12:18:34 2010
@@ -50,6 +50,7 @@ Trunk (unreleased changes)
 
   IMPROVEMENTS
     
+    HAMA-329: Add taskNum argument to pi estimator (edwardyoon)
     HAMA-313: Remove LocalJobRunner (edwardyoon)
     HAMA-321: Allows user to set the number of tasks (edwardyoon) 
     HAMA-282: Add superstep counter (Filipe Manana via edwardyoon)

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=1033910&r1=1033909&r2=1033910&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 Thu Nov 11 12:18:34 2010
@@ -99,10 +99,17 @@ public class PiEstimator {
     // Set the job name
     bsp.setJobName("pi estimation example");
     bsp.setBspClass(MyEstimator.class);
-    bsp.setNumBspTask(1);
     
     BSPJobClient jobClient = new BSPJobClient(conf);
     ClusterStatus cluster = jobClient.getClusterStatus(true);
+    
+    if(args.length > 0) {
+      bsp.setNumBspTask(Integer.parseInt(args[0]));
+    } else {
+      // Set to maximum
+      bsp.setNumBspTask(cluster.getGroomServers());
+    }
+    
     // Choose one as a master
     for (String peerName : cluster.getActiveGroomNames().values()) {
       conf.set(MASTER_TASK, peerName);