Parcourir la source

added number of gc gates to output

Boyoung- il y a 8 ans
Parent
commit
148c75f70e

+ 12 - 2
src/protocols/Retrieve.java

@@ -128,8 +128,9 @@ public class Retrieve extends Protocol {
 		StopWatch ete_off = new StopWatch("ETE_offline");
 		StopWatch ete_on = new StopWatch("ETE_online");
 
-		sanityCheck();
+		long[] gates = new long[2];
 
+		sanityCheck();
 		System.out.println();
 
 		for (int i = 0; i < records; i++) {
@@ -161,9 +162,14 @@ public class Retrieve extends Protocol {
 
 					} else if (party == Party.Debbie) {
 						ete_off.start();
-						preretrieve.runD(predata[ti], md, ti, ti == 0 ? null : predata[ti - 1][0], timer);
+						long[] cnt = preretrieve.runD(predata[ti], md, ti, ti == 0 ? null : predata[ti - 1][0], timer);
 						ete_off.stop();
 
+						if (cycleIndex == 0) {
+							gates[0] += cnt[0];
+							gates[1] += cnt[1];
+						}
+
 					} else if (party == Party.Charlie) {
 						ete_off.start();
 						preretrieve.runC(predata[ti], md, ti, ti == 0 ? null : predata[ti - 1][0], timer);
@@ -255,5 +261,9 @@ public class Retrieve extends Protocol {
 			System.out.println(bandwidth[i].noPreToString());
 		}
 		System.out.println();
+
+		System.out.println(gates[0]);
+		System.out.println(gates[1]);
+		System.out.println();
 	}
 }

+ 3 - 2
src/protocols/precomputation/PreEviction.java

@@ -128,9 +128,9 @@ public class PreEviction extends Protocol {
 		timer.stop(pid, M.offline_comp);
 	}
 
-	public void runD(PreData predata, boolean firstTree, int d, int w, int[] tupleParam, Timer timer) {
+	public long runD(PreData predata, boolean firstTree, int d, int w, int[] tupleParam, Timer timer) {
 		if (firstTree)
-			return;
+			return 0;
 
 		timer.start(pid, M.offline_comp);
 
@@ -182,6 +182,7 @@ public class PreEviction extends Protocol {
 		pressxot.runD(predata, d * W, d * W, tupleParam, timer);
 
 		timer.stop(pid, M.offline_comp);
+		return eva.numOfAnds;
 	}
 
 	public void runC(PreData predata, boolean firstTree, Timer timer) {

+ 10 - 5
src/protocols/precomputation/PreRetrieve.java

@@ -38,7 +38,7 @@ public class PreRetrieve extends Protocol {
 		preeviction.runE(predata[1], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), timer);
 	}
 
-	public void runD(PreData[] predata, Metadata md, int ti, PreData prev, Timer timer) {
+	public long[] runD(PreData[] predata, Metadata md, int ti, PreData prev, Timer timer) {
 		// 1st eviction
 		PreAccess preaccess = new PreAccess(con1, con2);
 		PreReshuffle prereshuffle = new PreReshuffle(con1, con2);
@@ -48,16 +48,21 @@ public class PreRetrieve extends Protocol {
 
 		int[] tupleParam = new int[] { ti == 0 ? 0 : 1, md.getNBytesOfTree(ti), md.getLBytesOfTree(ti),
 				md.getABytesOfTree(ti) };
+		long[] cnt = new long[2];
 
 		preaccess.runD(predata[0], timer);
 		prereshuffle.runD(predata[0], tupleParam, timer);
 		prepostprocesst.runD(predata[0], prev, md.getLBytesOfTree(ti), md.getAlBytesOfTree(ti), md.getTau(), timer);
-		preupdateroot.runD(predata[0], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), tupleParam, timer);
-		preeviction.runD(predata[0], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), tupleParam, timer);
+		cnt[0] += preupdateroot.runD(predata[0], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), tupleParam,
+				timer);
+		cnt[1] += preeviction.runD(predata[0], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), tupleParam, timer);
 
 		// 2nd eviction
-		preupdateroot.runD(predata[1], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), tupleParam, timer);
-		preeviction.runD(predata[1], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), tupleParam, timer);
+		cnt[0] += preupdateroot.runD(predata[1], ti == 0, md.getStashSizeOfTree(ti), md.getLBitsOfTree(ti), tupleParam,
+				timer);
+		cnt[1] += preeviction.runD(predata[1], ti == 0, md.getLBitsOfTree(ti) + 1, md.getW(), tupleParam, timer);
+
+		return cnt;
 	}
 
 	public void runC(PreData[] predata, Metadata md, int ti, PreData prev, Timer timer) {

+ 3 - 2
src/protocols/precomputation/PreUpdateRoot.java

@@ -74,9 +74,9 @@ public class PreUpdateRoot extends Protocol {
 		timer.stop(pid, M.offline_comp);
 	}
 
-	public void runD(PreData predata, boolean firstTree, int sw, int lBits, int[] tupleParam, Timer timer) {
+	public long runD(PreData predata, boolean firstTree, int sw, int lBits, int[] tupleParam, Timer timer) {
 		if (firstTree)
-			return;
+			return 0;
 
 		timer.start(pid, M.offline_comp);
 
@@ -108,6 +108,7 @@ public class PreUpdateRoot extends Protocol {
 		pressxot.runD(predata, sw + 1, sw, tupleParam, timer);
 
 		timer.stop(pid, M.offline_comp);
+		return eva.numOfAnds;
 	}
 
 	public void runC(PreData predata, boolean firstTree, Timer timer) {