From ab9c0edf10907a575ae1145102d5de4051a9865d Mon Sep 17 00:00:00 2001 From: Horst Schirmeier Date: Fri, 15 Nov 2013 16:14:12 +0100 Subject: [PATCH] DatabaseCampaign: run jobs for known-outcome exps, too Although we know that a known_outcome=1 pilot does not exhibit behavior different from the golden run, the database schema does not yet know what this behavior looks like (in terms of result-table column values). In order to be able to JOIN valid results for all memory writes in the trace table (fspgroup maps them all onto *one* pilot per variant), we need to run these experiments, too. Additionally, don't join the fspgroup table; we only need this one for result calculations afterwards. Change-Id: Idcd2991274fede84526b1eee68a231774625d11a --- src/core/cpn/DatabaseCampaign.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/core/cpn/DatabaseCampaign.cc b/src/core/cpn/DatabaseCampaign.cc index d42abb93..2290cdc6 100644 --- a/src/core/cpn/DatabaseCampaign.cc +++ b/src/core/cpn/DatabaseCampaign.cc @@ -112,14 +112,12 @@ void DatabaseCampaign::collect_result_thread() { bool DatabaseCampaign::run_variant(Database::Variant variant) { /* Gather all unfinished jobs */ int experiment_count; - std::string sql_select = "SELECT pilot_id, g.fspmethod_id, g.variant_id, p.injection_instr, p.injection_instr_absolute, g.data_address, p.data_width "; + std::string sql_select = "SELECT p.id, p.fspmethod_id, p.variant_id, p.injection_instr, p.injection_instr_absolute, p.data_address, p.data_width "; std::stringstream ss; - ss << " FROM fspgroup g" - << " INNER JOIN fsppilot p ON p.id = g.pilot_id " - << " WHERE p.known_outcome = 0 " - << " AND g.fspmethod_id = " << fspmethod_id - << " AND g.variant_id = " << variant.id - << " AND (SELECT COUNT(*) FROM " + db_connect.result_table() + " as r WHERE r.pilot_id = g.pilot_id)" + ss << " FROM fsppilot p " + << " WHERE p.fspmethod_id = " << fspmethod_id + << " AND p.variant_id = " << variant.id + << " AND (SELECT COUNT(*) FROM " + db_connect.result_table() + " as r WHERE r.pilot_id = p.id)" << " < " << expected_number_of_results(variant.variant, variant.benchmark) << " ORDER BY p.injection_instr"; std::string sql_body = ss.str();