hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r1442463 - /hama/trunk/core/src/main/java/org/apache/hama/bsp/PartitioningRunner.java
Date Tue, 05 Feb 2013 03:59:18 GMT
Author: edwardyoon
Date: Tue Feb  5 03:59:18 2013
New Revision: 1442463

URL: http://svn.apache.org/viewvc?rev=1442463&view=rev
Log:
Quick fix arithmetic exception bug.

Modified:
    hama/trunk/core/src/main/java/org/apache/hama/bsp/PartitioningRunner.java

Modified: hama/trunk/core/src/main/java/org/apache/hama/bsp/PartitioningRunner.java
URL: http://svn.apache.org/viewvc/hama/trunk/core/src/main/java/org/apache/hama/bsp/PartitioningRunner.java?rev=1442463&r1=1442462&r2=1442463&view=diff
==============================================================================
--- hama/trunk/core/src/main/java/org/apache/hama/bsp/PartitioningRunner.java (original)
+++ hama/trunk/core/src/main/java/org/apache/hama/bsp/PartitioningRunner.java Tue Feb  5 03:59:18
2013
@@ -182,7 +182,13 @@ public class PartitioningRunner extends
     for (int j = 0; j < status.length; j++) {
       int partitionID = Integer.parseInt(status[j].getPath().getName()
           .split("[-]")[1]);
-      int assignedID = partitionID / (desiredNum / peer.getNumPeers());
+      System.out.println(desiredNum + ", " + peer.getNumPeers());
+      int denom = desiredNum / peer.getNumPeers();
+      int assignedID = partitionID;
+      if(denom > 1) {
+        assignedID = partitionID / (desiredNum / peer.getNumPeers());
+      }
+      
       if (assignedID == peer.getNumPeers())
         assignedID = assignedID - 1;
 



Mime
View raw message