formatting, typos, comments, details
Change-Id: Iae5f1acb653a694622e9ac2bad93efcfca588f3a
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#ifndef __CAMPAIGN_HPP__
|
||||
#define __CAMPAIGN_HPP__
|
||||
#define __CAMPAIGN_HPP__
|
||||
|
||||
namespace fail {
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#ifndef __CAMPAIGN_MANAGER_HPP__
|
||||
#define __CAMPAIGN_MANAGER_HPP__
|
||||
#define __CAMPAIGN_MANAGER_HPP__
|
||||
|
||||
#include "sal/SALInst.hpp"
|
||||
#include "comm/ExperimentData.hpp"
|
||||
@ -16,7 +16,7 @@ namespace fail {
|
||||
/**
|
||||
* \class CampaignManager
|
||||
*
|
||||
* The CampaignManager allows a user-campaign access to all constant
|
||||
* The CampaignManager allows a user-campaign access to all constant
|
||||
* simulator information and forwards single experiments to the JobServer.
|
||||
*/
|
||||
class CampaignManager {
|
||||
@ -30,12 +30,12 @@ public:
|
||||
* Executes a user campaign
|
||||
*/
|
||||
bool runCampaign(Campaign* c)
|
||||
{
|
||||
{
|
||||
if (!m_jobserver) {
|
||||
m_jobserver = new JobServer;
|
||||
}
|
||||
m_currentCampaign = c;
|
||||
bool ret = c->run();
|
||||
bool ret = c->run();
|
||||
m_jobserver->done();
|
||||
return ret;
|
||||
}
|
||||
@ -43,7 +43,7 @@ public:
|
||||
* Returns a const reference for acquiring constant simulator specific information.
|
||||
* e.g., Registernames, to ease experiment data construction.
|
||||
* The campaign description is not allowed to change the simulator
|
||||
* state, as the actual simulation runs within another process (Minion)
|
||||
* state, as the actual simulation runs within another process (Minion)
|
||||
* @return constant reference to the current simulator backend.
|
||||
*/
|
||||
SimulatorController const& getSimulator() const { return simulator; }
|
||||
|
||||
@ -29,13 +29,13 @@ bool DatabaseCampaign::run() {
|
||||
if (!cb_commandline_init()) return false;
|
||||
|
||||
CommandLine::option_handle VARIANT = cmd.addOption("v", "variant", Arg::Required,
|
||||
"-v/--variant \tVariant label (default: \"none\")");
|
||||
"-v/--variant \tVariant label (default: \"none\"; use % and _ as wildcard characters)");
|
||||
CommandLine::option_handle BENCHMARK = cmd.addOption("b", "benchmark", Arg::Required,
|
||||
"-b/--benchmark \tBenchmark label (default: \"none\")\n");
|
||||
"-b/--benchmark \tBenchmark label (default: \"none\"; use % and _ as wildcard characters)\n");
|
||||
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;
|
||||
}
|
||||
@ -147,7 +147,7 @@ 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;
|
||||
|
||||
sent_pilots = 0;
|
||||
|
||||
@ -61,7 +61,7 @@ public:
|
||||
virtual bool cb_commandline_init() { return true; }
|
||||
|
||||
/**
|
||||
* Callback to the campagin to get the result message descriptor
|
||||
* Callback to the campaign to get the result message descriptor
|
||||
*/
|
||||
virtual const google::protobuf::Descriptor * cb_result_message() = 0;
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ void JobServer::run()
|
||||
// TODO: Log-level?
|
||||
#ifndef __puma
|
||||
boost::thread* th;
|
||||
while (!m_finish){
|
||||
while (!m_finish) {
|
||||
// Accept connection
|
||||
int cs = SocketComm::timedAccept(s, (struct sockaddr*)&clientaddr, &clen, 100);
|
||||
if (cs < 0) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#ifndef __JOB_SERVER_H__
|
||||
#define __JOB_SERVER_H__
|
||||
#define __JOB_SERVER_H__
|
||||
|
||||
#include "Minion.hpp"
|
||||
#include "util/SynchronizedQueue.hpp"
|
||||
@ -110,7 +110,7 @@ public:
|
||||
/**
|
||||
* Adds a new experiment data set to the job queue.
|
||||
* @param data Pointer to an expoeriment data object
|
||||
*/
|
||||
*/
|
||||
void addParam(ExperimentData* data);
|
||||
/**
|
||||
* Retrieve an experiment result. Blocks if we currently have no results.
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#ifndef __MINION_HPP__
|
||||
#define __MINION_HPP__
|
||||
#define __MINION_HPP__
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -14,14 +14,14 @@ namespace fail {
|
||||
|
||||
/**
|
||||
* \class Minion
|
||||
*
|
||||
* Contains all informations about a minion.
|
||||
*
|
||||
* Contains all informations about a minion.
|
||||
*/
|
||||
class Minion {
|
||||
private:
|
||||
std::string hostname;
|
||||
bool isWorking;
|
||||
ExperimentData* currentExperimentData;
|
||||
ExperimentData* currentExperimentData;
|
||||
int sockfd;
|
||||
public:
|
||||
Minion() : isWorking(false), currentExperimentData(0), sockfd(-1) { }
|
||||
|
||||
Reference in New Issue
Block a user