various comment/cleanups, no net effect
authoradam <adam@megacz.com>
Mon, 17 Nov 2008 01:25:31 +0000 (02:25 +0100)
committeradam <adam@megacz.com>
Mon, 17 Nov 2008 01:25:31 +0000 (02:25 +0100)
src/edu/berkeley/fleet/ir/Process.java
src/edu/berkeley/fleet/ir/ShipPool.java

index 4087064..b911cc0 100644 (file)
@@ -506,23 +506,30 @@ public class Process {
         fp = fleet.run(new Instruction[0]);
         Gadgets.writeMem(fp, mem1, 0, bv(vals));
         int vals_length = vals.length;
+
+        // Disable readback/writeback inside the loop
         vals = null;
 
         while(stride < vals_length) {
-            //if (fp==null) fp = fleet.run(new Instruction[0]);
+            
+            // reset the FleetProcess
+            //fp.terminate(); fp = null;
+
             System.out.println("stride " + stride);
+
+            // if we reset the FleetProcess, restart it
+            if (fp==null) fp = fleet.run(new Instruction[0]);
+
+            // do the mergeSort
             vals = mergeSort(fp, fleet, vals, vals_length, stride, mem1, mem2);
 
+            // verify the cleanup
+            //verifyClean(fp);
+
             Ship mem = mem1; mem1=mem2; mem2=mem;
 
             stride = stride * 2;
-            //fp.terminate(); fp = null;
             System.out.println();
-            /*
-            System.out.println("results:");
-            for(int i=0; i<vals.length; i++)
-                System.out.println(vals[i]);
-            */
         }
 
         BitVector[] bvs = new BitVector[vals_length];
@@ -691,8 +698,8 @@ public class Process {
         fp.flush();
 
         for(int i=0; i<vals_length; i++) {
-            System.out.print("\rreading back... " + i);
-            fp.recvWord();
+            System.out.print("\rreading back... " + i+"/"+vals_length+"  ");
+            System.out.print(" (prev result: " + fp.recvWord() + ")");
         }
         System.out.println("\rdone.                                                                    ");
 
index 07c0768..a3fee4f 100644 (file)
@@ -8,6 +8,8 @@ import edu.berkeley.fleet.api.Instruction.Set;
 import edu.berkeley.fleet.api.Instruction.Set.*;
 import static edu.berkeley.fleet.util.BitManipulations.*;
 
+// FEATURE: hierarchical ShipPools, wherein a ship may never be
+// allocated in two pools where one is an ancestor of the other
 public class ShipPool implements Iterable<Ship> {
 
     public final Fleet fleet;