Commit 8ea04ef3 authored by Carlos Galindo's avatar Carlos Galindo
Browse files

Benchmarks: use SC's id instead of a counter

parent 73d78e87
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -135,8 +135,8 @@ public abstract class AbstractBenchmark {
        return new File(getSliceTimeFolder(setName), moduleName + ".txt");
    }

    protected File getSliceCodeFile(String moduleName, String benchName, int scCounter) {
        return new File(new File(slicesFolder, setName + "_" + moduleName), benchName + "_" + scCounter + DOT_ERLANG);
    protected File getSliceCodeFile(String moduleName, String benchName, int scId) {
        return new File(new File(slicesFolder, setName + "_" + moduleName), benchName + "_" + scId + DOT_ERLANG);
    }

    public AbstractBenchmark(String setName) {
+2 −4
Original line number Diff line number Diff line
@@ -137,7 +137,6 @@ public class InterproceduralTerminatingBenchmark extends AbstractBenchmark {
    }

    protected void measureSlicing(String moduleName, EDG edg, Map<Node, List<Node>> clause2resNodes, Map<Node, String> clause2name, SlicingAlgorithm algorithm, boolean clearCache, String benchName) {
        int scCounter = 0;
        String bench = setName + "_" + benchName;
        getSliceTimeFolder(bench).mkdirs();
        for (Node clause : clause2resNodes.keySet()) {
@@ -145,7 +144,7 @@ public class InterproceduralTerminatingBenchmark extends AbstractBenchmark {
                double[] constrainedTime = new double[numberOfIterationsSlice];

                if (printSlices) {
                    File outFile = getSliceCodeFile(moduleName, benchName, scCounter);
                    File outFile = getSliceCodeFile(moduleName, benchName, SC.getId());
                    outFile.getParentFile().mkdirs();
                    if (clearCache) {
                        edg.clearState();
@@ -174,9 +173,8 @@ public class InterproceduralTerminatingBenchmark extends AbstractBenchmark {
                    }

                    printEachSCData(getSliceTimeFile(bench, moduleName), moduleName, clause2name.get(clause),
                            scCounter, constrainedTime, edg.getSummaryTable().cacheHits(), edg.getSummaryTable().hitRatio());
                            SC.getId(), constrainedTime, edg.getSummaryTable().cacheHits(), edg.getSummaryTable().hitRatio());
                }
                scCounter++;
            }
        }
    }