From 218cca31676c22257fd0bec4fe5e08508a3b87de Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 23 Jul 2020 17:22:03 +1000 Subject: [PATCH] remove unneeded existence check with provenance and interpreter this is now handled by the data structure, and also allows us to re-enable multi-threading with the interpreter and provenance --- src/AstTranslator.cpp | 29 ----------------------------- src/main.cpp | 2 ++ tests/provenance.at | 2 +- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/AstTranslator.cpp b/src/AstTranslator.cpp index 675ebf0a554..b8eb5efe4f0 100644 --- a/src/AstTranslator.cpp +++ b/src/AstTranslator.cpp @@ -491,35 +491,6 @@ std::unique_ptr AstTranslator::ClauseTranslator::createOperation(c std::make_unique(translator.translateRelation(head)), std::move(project)); } - // check existence for original tuple if we have provenance - // only if we don't compile - if (Global::config().has("provenance") && - ((!Global::config().has("compile") && !Global::config().has("dl-program") && - !Global::config().has("generate")))) { - size_t auxiliaryArity = translator.getEvaluationArity(head); - auto arity = head->getArity() - auxiliaryArity; - std::vector> values; - bool isVolatile = true; - auto args = head->getArguments(); - - // add args for original tuple - for (size_t i = 0; i < arity; i++) { - auto arg = args[i]; - // don't add counters - visitDepthFirst(*arg, [&](const AstCounter&) { isVolatile = false; }); - values.push_back(translator.translateValue(arg, valueIndex)); - } - for (size_t i = 0; i < auxiliaryArity; i++) { - values.push_back(std::make_unique()); - } - if (isVolatile) { - return std::make_unique( - std::make_unique(std::make_unique( - translator.translateRelation(head), std::move(values))), - std::move(project)); - } - } - // build up insertion call return project; // start with innermost } diff --git a/src/main.cpp b/src/main.cpp index 34029f73105..784548cba54 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -581,10 +581,12 @@ int main(int argc, char** argv) { profiler.join(); } if (Global::config().has("provenance")) { + /* // Test for bugged combination of provenance, interpreted souffle, and concurrency if (Global::config().get("jobs") != "1") { throw std::runtime_error("Provenance is not supported with parallel interpreted mode"); } + */ // only run explain interface if interpreted InterpreterProgInterface interface(*interpreter); diff --git a/tests/provenance.at b/tests/provenance.at index d564c28ddbe..66a3a942c87 100644 --- a/tests/provenance.at +++ b/tests/provenance.at @@ -21,7 +21,7 @@ dnl $1 -- test name dnl $2 -- category m4_define([POSITIVE_PROVENANCE_TEST],[ m4_ifblank(m4_join([],ENV_CONFS), [ - m4_define([PROV_FLAGS], [[], [-c], [-c -j8]]) + m4_define([PROV_FLAGS], [[], [-j8], [-c], [-c -j8]]) ], [ m4_define([PROV_FLAGS], [ENV_CONFS]) ])