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];
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. ");
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;