Commit 89592ff9 authored by Mahesh Tripunitara's avatar Mahesh Tripunitara

timeout per decision instance appears to work

parent f8e89ac7
Pipeline #5963 skipped
......@@ -3,6 +3,7 @@ package vagabond.reduction.cnfsat;
import java.io.*;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
......@@ -17,6 +18,8 @@ public class RunSolverCNFSAT implements RunSolver {
public static VagabondSettings settings;
public TimingManager timing = null;
public String tp = "Epoch_Unknown";
public static Logger logger;
String solverloc;
String cnfloc;// OLD VALUE = new String("/home/tripunit/Desktop/instance.cnf");
......@@ -26,6 +29,7 @@ public class RunSolverCNFSAT implements RunSolver {
public RunSolverCNFSAT() throws IOException {
settings = VagabondSettings.getInstance();
timing = settings.timing;
logger = settings.getLogger();
solverloc = settings.getCNFSolverExceutable().getAbsolutePath();
cnfloc = settings.getCNFInstanceFile().getAbsolutePath();
}
......@@ -133,6 +137,7 @@ public class RunSolverCNFSAT implements RunSolver {
+ StringUtils.leftPad(mid + "", (int) Math.floor(Math.log10(hi)) + 1, "0");
/*TIMING*/ timing.toggleTimer(tp + "RunSolverCNFSAT::run::binarySearch::loopVal::" + searchVal);
// System.out.println("mid = "+mid); System.out.flush();
logger.info("mid = "+mid);
try {
constraintInfoLeakUb(c, le, band, s, nclientpairs, mid, wirestoand, orignoutputs);
......@@ -148,6 +153,7 @@ public class RunSolverCNFSAT implements RunSolver {
if (mid < hi && EACH_DECISION_INSTANCE_TIMEOUT > 0
&& !p.waitFor(EACH_DECISION_INSTANCE_TIMEOUT, TimeUnit.SECONDS)) {
// Treat this as unsat
p.destroyForcibly();
lo = mid + 1;
/*TIMING*/ timing.toggleTimer(tp + "RunSolverCNFSAT::run::binarySearch::exec::" + searchVal);
continue;
......
......@@ -23,9 +23,6 @@ public class CNFEverythingTests {
@Test
public void equalSpreadTest() throws Exception {
Circuit.resetIDs();
ZeroOne.reset();
boolean minMaxCtoCInfoLeak = true;
VagabondSettings vs = VagabondSettings.getInstance();
......@@ -64,9 +61,6 @@ public class CNFEverythingTests {
@Test
public void equalSpreadBiggerTest() throws Exception {
Circuit.resetIDs();
ZeroOne.resetIDs();
int testparam = 8;
int migbudget = 5;
boolean minMaxCtoCInfoLeak = false;
......@@ -106,9 +100,6 @@ public class CNFEverythingTests {
@Test
public void nomadILPTest() throws Exception {
Circuit.resetIDs();
ZeroOne.reset();
boolean minMaxCtoCInfoLeak = true;
VagabondSettings vs = VagabondSettings.getInstance();
......
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