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
This commit is contained in:
Horst Schirmeier
2013-11-15 16:14:12 +01:00
committed by Horst Schirmeier
parent 8b6d744a3e
commit ab9c0edf10

View File

@ -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();