Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63431710
blackdynamite.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, May 20, 02:10
Size
3 KB
Mime Type
text/x-c++
Expires
Wed, May 22, 02:10 (2 d)
Engine
blob
Format
Raw Data
Handle
17764982
Attached To
R3127 blackdynamite
blackdynamite.hh
View Options
/*
author : Nicolas RICHART <nicolas.richart@epfl.ch>
author : Guillaume ANCIAUX (anciaux@labri.fr, g.anciaux@laposte.net)
author : Till JUNGE <till.junge@epfl.ch>
*/
/* -------------------------------------------------------------------------- */
#ifndef __BLACKDYNAMITE_PUSHER_HH__
#define __BLACKDYNAMITE_PUSHER_HH__
#include <string>
/* -------------------------------------------------------------------------- */
namespace BlackDynamite {
typedef unsigned int UInt;
typedef double Real;
class SQLConnectionManager;
class StateManager;
class QuantitiesManager;
class RunManager {
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
public:
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
RunManager();
RunManager(const std::string & dbname, const std::string & user,
const std::string & host, const std::string & schema,
const std::string & password, UInt run_id);
virtual ~RunManager();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
//! function to be called to update the state of the job at the begining of
// the run
void startRun();
//! function to be called to update the state of the job at the end of the run
void endRun();
//! change the state of a run
void changeState(const std::string & state);
//! template method that pushes a value associated with a quantity at a
// particular timestep
template <typename T>
void push(const T & value, const std::string & quantity, const UInt & step);
//! template method that pushes a string to a given run column
void push(const std::string & value, const std::string & quantity);
//! give the number of instance of blackdynamite
UInt getInstanceCounter();
/// defines how many times requests should be retired on failure
UInt setNbRetriesOnRequests(UInt retries) { this->request_retries = retries; }
protected:
//! initialisation method
void init(const std::string & dbname, const std::string & user,
const std::string & host, const std::string & schema,
const std::string & password, UInt run_id);
//! read the password from .blacdynamite directory
std::string readPassword(const std::string & host);
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
protected:
UInt run_id;
std::string sql_schema;
SQLConnectionManager * sql_connection_manager;
StateManager * state_manager;
QuantitiesManager * quantities_manager;
UInt request_retries;
};
/* -------------------------------------------------------------------------- */
}
#endif /* __BLACKDYNAMITE_PUSHER_HH__ */
Event Timeline
Log In to Comment