ecos: load existing results on campaign startup
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1926 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -312,6 +312,8 @@ bool EcosKernelTestCampaign::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
available_results.clear();
|
||||||
|
|
||||||
campaignmanager.noMoreParameters();
|
campaignmanager.noMoreParameters();
|
||||||
m_log << "total"
|
m_log << "total"
|
||||||
<< " exp " << count_exp << " (" << count_exp_jobs << " jobs)"
|
<< " exp " << count_exp << " (" << count_exp_jobs << " jobs)"
|
||||||
@ -371,7 +373,7 @@ bool EcosKernelTestCampaign::run()
|
|||||||
bool EcosKernelTestCampaign::add_experiment_ec(const std::string& variant, const std::string& benchmark,
|
bool EcosKernelTestCampaign::add_experiment_ec(const std::string& variant, const std::string& benchmark,
|
||||||
address_t data_address, int instr1, int instr2, address_t instr_absolute)
|
address_t data_address, int instr1, int instr2, address_t instr_absolute)
|
||||||
{
|
{
|
||||||
if (check_available(data_address, instr2)) {
|
if (check_available(variant, benchmark, data_address, instr2)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -396,7 +398,7 @@ bool EcosKernelTestCampaign::add_experiment_ec(const std::string& variant, const
|
|||||||
bool EcosKernelTestCampaign::add_known_ec(const std::string& variant, const std::string& benchmark,
|
bool EcosKernelTestCampaign::add_known_ec(const std::string& variant, const std::string& benchmark,
|
||||||
address_t data_address, int instr1, int instr2, address_t instr_absolute)
|
address_t data_address, int instr1, int instr2, address_t instr_absolute)
|
||||||
{
|
{
|
||||||
if (check_available(data_address, instr2)) {
|
if (check_available(variant, benchmark, data_address, instr2)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -423,34 +425,32 @@ bool EcosKernelTestCampaign::init_results()
|
|||||||
ifstream oldresults(filename_results().c_str(), ios::in);
|
ifstream oldresults(filename_results().c_str(), ios::in);
|
||||||
if (oldresults.is_open()) {
|
if (oldresults.is_open()) {
|
||||||
file_exists = true;
|
file_exists = true;
|
||||||
/* TODO
|
|
||||||
char buf[16*1024];
|
char buf[16*1024];
|
||||||
|
std::string variant, benchmark;
|
||||||
unsigned ignore;
|
unsigned ignore;
|
||||||
unsigned instr_offset;
|
int instr2;
|
||||||
int register_id;
|
address_t data_address;
|
||||||
uint64_t bitmask;
|
int bit_width;
|
||||||
int rowcount = 0;
|
int rowcount = 0;
|
||||||
int expcount = 0;
|
int expcount = 0;
|
||||||
m_log << "scanning existing results ..." << endl;
|
m_log << "scanning existing results ..." << endl;
|
||||||
file_exists = true;
|
|
||||||
while (oldresults.getline(buf, sizeof(buf)).good()) {
|
while (oldresults.getline(buf, sizeof(buf)).good()) {
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
ss << buf;
|
ss << buf;
|
||||||
ss >> hex >> ignore >> instr_offset >> ignore >> register_id >> ignore
|
ss >> hex >> variant >> benchmark >> ignore >> instr2 >> ignore
|
||||||
>> ignore >> bitmask;
|
>> data_address >> ignore >> bit_width;
|
||||||
if (ss.fail()) {
|
if (ss.fail()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
++rowcount;
|
++rowcount;
|
||||||
expcount += count_1bits(bitmask);
|
expcount += bit_width;
|
||||||
// TODO: sanity check (duplicates?)
|
// TODO: sanity check (duplicates?)
|
||||||
available_results
|
available_results
|
||||||
[std::pair<unsigned, int>(instr_offset, register_id)]
|
[AvailableResultMap::key_type(variant, benchmark)]
|
||||||
|= bitmask;
|
[data_address].insert(instr2);
|
||||||
}
|
}
|
||||||
m_log << "found " << dec << expcount << " existing experiment results ("
|
m_log << "found " << dec << expcount << " existing experiment results ("
|
||||||
<< rowcount << " CSV rows)" << endl;
|
<< rowcount << " CSV rows)" << endl;
|
||||||
*/
|
|
||||||
oldresults.close();
|
oldresults.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,10 +471,25 @@ bool EcosKernelTestCampaign::init_results()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EcosKernelTestCampaign::check_available(address_t data_address, int instr2)
|
bool EcosKernelTestCampaign::check_available(const std::string& variant, const std::string& benchmark,
|
||||||
|
address_t data_address, int instr2)
|
||||||
{
|
{
|
||||||
// TODO
|
AvailableResultMap::const_iterator it_variant =
|
||||||
return false;
|
available_results.find(AvailableResultMap::key_type(variant, benchmark));
|
||||||
|
if (it_variant == available_results.end()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
AvailableResultMap::mapped_type::const_iterator it_address =
|
||||||
|
it_variant->second.find(data_address);
|
||||||
|
if (it_address == it_variant->second.end()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
AvailableResultMap::mapped_type::mapped_type::const_iterator it_instr =
|
||||||
|
it_address->second.find(instr2);
|
||||||
|
if (it_instr == it_address->second.end()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EcosKernelTestCampaign::add_result(const std::string& variant, const std::string& benchmark,
|
void EcosKernelTestCampaign::add_result(const std::string& variant, const std::string& benchmark,
|
||||||
|
|||||||
@ -32,9 +32,10 @@ class EcosKernelTestCampaign : public fail::Campaign {
|
|||||||
int bitnr, int bit_width, int resulttype, int ecos_test_result, fail::address_t latest_ip,
|
int bitnr, int bit_width, int resulttype, int ecos_test_result, fail::address_t latest_ip,
|
||||||
int error_corrected, const std::string& details);
|
int error_corrected, const std::string& details);
|
||||||
void finalize_results();
|
void finalize_results();
|
||||||
bool check_available(fail::address_t data_address, int instr2);
|
bool check_available(const std::string& variant, const std::string& benchmark, fail::address_t data_address, int instr2);
|
||||||
std::ofstream resultstream;
|
std::ofstream resultstream;
|
||||||
std::map<std::pair<unsigned, int>, uint64_t> available_results;
|
typedef std::map<std::pair<const std::string, const std::string>, std::map<fail::address_t, std::set<int> > > AvailableResultMap;
|
||||||
|
AvailableResultMap available_results;
|
||||||
public:
|
public:
|
||||||
EcosKernelTestCampaign() : m_log("EcosKernelTest Campaign"),
|
EcosKernelTestCampaign() : m_log("EcosKernelTest Campaign"),
|
||||||
count_exp(0), count_exp_jobs(0), count_known(0), count_known_jobs(0) {}
|
count_exp(0), count_exp_jobs(0), count_known(0), count_known_jobs(0) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user