Commit f8e89ac7 authored by Mahesh Tripunitara's avatar Mahesh Tripunitara
Browse files

fixes

parent 1d77ec06
No preview for this file type
......@@ -421,7 +421,7 @@ public class ReduceToCNFSAT implements ReduceTo {
}
@Override
public boolean reduce(EpochHistory eh) {
public boolean reduce(EpochHistory eh) throws Exception {
// We'll store eh so we can map back the CNF-SAT certificate
// to a placement map.
......@@ -438,6 +438,7 @@ public class ReduceToCNFSAT implements ReduceTo {
}
Circuit.resetIDs();
ZeroOne.reset();
Circuit c = new Circuit();
/*
......
......@@ -174,6 +174,7 @@ public class RunSolverCNFSAT implements RunSolver {
recordlines = true;
}
}
p.destroyForcibly();
/*TIMING*/ timing.toggleTimer(tp + "RunSolverCNFSAT::run::binarySearch::exec::" + searchVal);
if (!recordlines)
......
......@@ -5,6 +5,8 @@ package vagabond.testing;
import org.junit.Test;
import vagabond.circuit.Circuit;
import vagabond.circuit.ZeroOne;
import vagabond.pieces.EpochHistory;
import vagabond.pieces.PlacementMap;
import vagabond.placement.RandomPlacement;
......@@ -21,6 +23,9 @@ public class CNFEverythingTests {
@Test
public void equalSpreadTest() throws Exception {
Circuit.resetIDs();
ZeroOne.reset();
boolean minMaxCtoCInfoLeak = true;
VagabondSettings vs = VagabondSettings.getInstance();
......@@ -59,6 +64,9 @@ public class CNFEverythingTests {
@Test
public void equalSpreadBiggerTest() throws Exception {
Circuit.resetIDs();
ZeroOne.resetIDs();
int testparam = 8;
int migbudget = 5;
boolean minMaxCtoCInfoLeak = false;
......@@ -98,6 +106,9 @@ public class CNFEverythingTests {
@Test
public void nomadILPTest() throws Exception {
Circuit.resetIDs();
ZeroOne.reset();
boolean minMaxCtoCInfoLeak = true;
VagabondSettings vs = VagabondSettings.getInstance();
......
......@@ -18,6 +18,7 @@ import vagabond.circuit.Sum;
import vagabond.pieces.EpochHistory;
import vagabond.reduction.cnfsat.ReduceToCNFSAT;
import vagabond.reduction.cnfsat.RunSolverCNFSAT;
import vagabond.singleton.VagabondSettings;
/**
* @author tripunit
......@@ -197,8 +198,20 @@ public class InfoLeakSumTests {
LessEquals le[] = new LessEquals[nclientpairs];
for(int i = 0; i < nclientpairs; i++) le[i] = null;
int ub = 5; // Change this as needed. < 8 should result in false. > 7 should result in true
Circuit.Wire wirestoand[] = new Circuit.Wire[c.getOutputs().size()];
for(int i = 0; i < wirestoand.length; i++) {
Circuit.Wire wirestoand[];
if (VagabondSettings.getInstance().minimizeMaxClientToClientInfoLeak) {
wirestoand = new Circuit.Wire[c.getOutputs().size() + nclientpairs];
} else {
wirestoand = new Circuit.Wire[c.getOutputs().size() + 1];
}
for (int i = 0; i < c.getOutputs().size(); i++) {
wirestoand[i] = c.getOutputs().get(0);
c.removeAsOutput(wirestoand[i]);
}
for(int i = 0; i < c.getOutputs().size(); i++) {
wirestoand[i] = c.getOutputs().get(i);
}
BigAndOr band[] = new BigAndOr[1]; band[0] = null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment