cleanups
Change-Id: I8022d937477668253c613e97c3a579ae65084b1e
This commit is contained in:
@ -6,17 +6,17 @@ set(SRCS
|
||||
|
||||
# only compile concrete implementation of InjectionPoint
|
||||
if(CONFIG_INJECTIONPOINT_HOPS)
|
||||
set (SRCS ${SRCS} InjectionPointHops.cc)
|
||||
set (SRCS ${SRCS} InjectionPointHops.cc)
|
||||
else(CONFIG_INJECTIONPOINT_HOPS)
|
||||
set (SRCS ${SRCS} InjectionPointSteps.cc)
|
||||
set (SRCS ${SRCS} InjectionPointSteps.cc)
|
||||
endif(CONFIG_INJECTIONPOINT_HOPS)
|
||||
|
||||
add_library(fail-cpn ${SRCS})
|
||||
|
||||
# if hop-chains need to be calculated by the server, we
|
||||
# if hop-chains need to be calculated by the server, we
|
||||
# the smarthopping module
|
||||
if(CONFIG_INJECTIONPOINT_HOPS)
|
||||
add_dependencies(fail-cpn fail-smarthops)
|
||||
add_dependencies(fail-cpn fail-smarthops)
|
||||
endif(CONFIG_INJECTIONPOINT_HOPS)
|
||||
|
||||
add_dependencies(fail-cpn fail-comm)
|
||||
|
||||
@ -35,7 +35,7 @@ bool DatabaseCampaign::run() {
|
||||
CommandLine::option_handle PRUNER = cmd.addOption("p", "prune-method", Arg::Required,
|
||||
"-p/--prune-method \tWhich import method to use (default: basic)");
|
||||
|
||||
if(!cmd.parse()) {
|
||||
if (!cmd.parse()) {
|
||||
log_send << "Error parsing arguments." << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
@ -82,7 +82,7 @@ bool DatabaseCampaign::run() {
|
||||
std::vector<Database::Variant> variants = db->get_variants(variant, benchmark);
|
||||
for (std::vector<Database::Variant>::const_iterator it = variants.begin();
|
||||
it != variants.end(); ++it) {
|
||||
if(!run_variant(*it)) {
|
||||
if (!run_variant(*it)) {
|
||||
log_send << "run_variant failed for " << it->variant << "/" << it->benchmark <<std::endl;
|
||||
return false;
|
||||
}
|
||||
@ -133,12 +133,13 @@ bool DatabaseCampaign::run_variant(Database::Variant variant) {
|
||||
|
||||
MYSQL_RES *pilots = db->query_stream ((sql_select + sql_body).c_str());
|
||||
|
||||
log_send << "Found " << experiment_count << " unfinished experiments in database. ("
|
||||
log_send << "Found " << experiment_count << " unfinished experiments in database. ("
|
||||
<< variant.variant << "/" << variant.benchmark << ")" << std::endl;
|
||||
|
||||
// abstraction of injection point
|
||||
// must not be initialized in loop, because hop chain calculator would loose state after loop pass
|
||||
// and so for every hop chain it would have to begin calculating at trace instruction zero
|
||||
// abstraction of injection point:
|
||||
// must not be initialized in loop, because hop chain calculator would lose
|
||||
// state after loop pass and so for every hop chain it would have to begin
|
||||
// calculating at trace instruction zero
|
||||
ConcreteInjectionPoint ip;
|
||||
|
||||
sent_pilots = 0;
|
||||
|
||||
@ -58,7 +58,7 @@ class SmartHops;
|
||||
/**
|
||||
* \class InjectionPointHops
|
||||
*
|
||||
* Concrete injection point which contains a hop chain to the target
|
||||
* Concrete injection point which contains a hop chain to the target
|
||||
* trace instruction.
|
||||
*/
|
||||
class InjectionPointHops : public InjectionPointBase {
|
||||
@ -79,7 +79,7 @@ public:
|
||||
m_curr_instr2(-1), m_initialized(false) {}
|
||||
|
||||
virtual ~InjectionPointHops();
|
||||
|
||||
|
||||
/**
|
||||
* Parses a hop chain from a injection instruction (trace offset).
|
||||
* @param instr1 trace instruction offset of beginning of equivalence class
|
||||
@ -101,7 +101,7 @@ typedef InjectionPointHops ConcreteInjectionPoint;
|
||||
class InjectionPointSteps : public InjectionPointBase {
|
||||
public:
|
||||
virtual ~InjectionPointSteps() {}
|
||||
|
||||
|
||||
/**
|
||||
* Parses a trace offset from a injection instruction (trace offset),
|
||||
* so it effectively just stores the value in the protobuf message.
|
||||
|
||||
@ -6,10 +6,10 @@
|
||||
|
||||
namespace fail {
|
||||
|
||||
|
||||
InjectionPointHops::~InjectionPointHops() {
|
||||
if (m_initialized)
|
||||
if (m_initialized) {
|
||||
delete m_sa;
|
||||
}
|
||||
}
|
||||
|
||||
void InjectionPointHops::init()
|
||||
@ -17,11 +17,11 @@ void InjectionPointHops::init()
|
||||
m_sa = new SmartHops();
|
||||
|
||||
char * elfpath = getenv("FAIL_TRACE_PATH");
|
||||
if(elfpath == NULL){
|
||||
if (elfpath == NULL) {
|
||||
m_log << "FAIL_TRACE_PATH not set :(" << std::endl;
|
||||
exit(-1);
|
||||
}else{
|
||||
m_sa->init((const char*)elfpath);
|
||||
} else {
|
||||
m_sa->init((const char*) elfpath);
|
||||
}
|
||||
|
||||
m_initialized = true;
|
||||
@ -74,7 +74,7 @@ void InjectionPointHops::parseFromInjectionInstr(unsigned instr1, unsigned instr
|
||||
if (!m_sa->calculateFollowingHop(m, new_curr_instr2)) {
|
||||
m_log << "FATAL ERROR: Trace does not contain enough instructions (no instruction with offset "
|
||||
<< new_curr_instr2 << ")" << std::endl;
|
||||
exit(-1);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
m_results.push_back(m);
|
||||
@ -93,7 +93,7 @@ void InjectionPointHops::parseFromInjectionInstr(unsigned instr1, unsigned instr
|
||||
if (search == search_end) {
|
||||
m_ip = *search;
|
||||
} else {
|
||||
for(;search != search_end; search++) {
|
||||
for (;search != search_end; search++) {
|
||||
if (!search->has_costs()) {
|
||||
m_log << "FATAL ERROR: Costs must be delivered in order to calculate minimum costs" << std::endl;
|
||||
exit(-1);
|
||||
|
||||
Reference in New Issue
Block a user