Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
hype::core::Scheduler Class Reference

The Scheduler is the central component for interaction of the application and the library. More...

#include <scheduler.hpp>

Collaboration diagram for hype::core::Scheduler:

List of all members.

Classes

class  ProcessingDevices

Public Types

typedef std::map< std::string,
std::tr1::shared_ptr
< Operation > > 
MapNameToOperation

Public Member Functions

bool addAlgorithm (const AlgorithmSpecification &alg_spec, const DeviceSpecification &dev_spec)
 adds an Algorithm to the AlgorithmPool of an operation defined by alg_spec on the processing device defined by dev_spec.
bool setOptimizationCriterion (const std::string &name_of_operation, const std::string &name_of_optimization_criterion)
 assigns the OptimizationCriterion name_of_optimization_criterion to Operation name_of_operation
bool setStatisticalMethod (const std::string &name_of_algorithm, const std::string &name_of_statistical_method)
 assigns the StatisticalMethod name_of_statistical_method to an existing Algorithm
bool setRecomputationHeuristic (const std::string &name_of_algorithm, const std::string &name_of_recomputation_strategy)
 assigns the StatisticalMethod name_of_statistical_method to an existing Algorithm
const SchedulingDecision getOptimalAlgorithm (const OperatorSpecification &op_spec, const DeviceConstraint &dev_constr)
 Returns a Scheduling Decision, which contains the name of the estimated optimal Algorithm w.r.t. the user specified optimization criterion.
bool addObservation (const SchedulingDecision &sched_dec, const double &measured_execution_time)
 adds an observed execution time to the algorithm previously choosen by getOptimalAlgorithmName.
const AlgorithmPtr getAlgorithm (const std::string &name_of_algorithm)
 requests a pointer to Algorithm named name_of_algorithm
EstimatedTime getEstimatedExecutionTime (const OperatorSpecification &op_spec, const std::string &alg_name)
void print ()
ProcessingDevicesgetProcessingDevices ()

Static Public Member Functions

static Schedulerinstance ()
 This method implements the singelton concept for the Scheduler class to avoid multiple instances.

Private Member Functions

 Scheduler ()
 Constructor is private to avoid multiple instances of Scheduler.
 Scheduler (const Scheduler &)
 Copy Constructor is private to avoid copying of the single instance of Scheduler.
Scheduleroperator= (const Scheduler &)
 Copy assignment operator is private to avoid copying of the single instance of Scheduler.

Private Attributes

MapNameToOperation map_operationname_to_operation_
 maps the name of an Operation to a pointer to an Operation object
StatisticalMethodMap map_statisticalmethodname_to_statisticalmethod_
 maps the name of a StatisticalMethod to a pointer to a StatisticalMethod object
ProcessingDevices proc_devs_
 stores the processing devices, which were specified by the user

Detailed Description

The Scheduler provides two main functionalities. First, it provides the service to decide on the optimal algorithm for an operation w.r.t. a user specified optimization criterion. Second, the Scheduler implements an interface to add new Observations to the executed Algorithm. Hence, it is the central component for interaction of the application and the library. Since it is not meaningful to have multiple instances of the Scheduler class, it is not possible to create multiple Scheduler instances. This property is implemented by using the singelton concept. Additionally, the Scheduler enables the user to setup the Operations with their respective Algorithms as well as to configure for each algorithm a statistical method and a recomputation heuristic and for each operation an optimization criterion. Note that the statistical method and the recomputation statistic can be exchanged at run-time, because the Algortihm uses the pointer to implementation technique (or pimpl-idiom).

Author:
Sebastian BreƟ
Version:
0.1
Date:
2012

Definition at line 37 of file scheduler.hpp.


Member Typedef Documentation

typedef std::map<std::string,std::tr1::shared_ptr<Operation> > hype::core::Scheduler::MapNameToOperation

Definition at line 40 of file scheduler.hpp.


Constructor & Destructor Documentation

Definition at line 18 of file scheduler.cpp.

References hype::core::PluginLoader::loadPlugins().

Here is the call graph for this function:

Parameters:
referenceto existing Scheduler object

Member Function Documentation

bool hype::core::Scheduler::addAlgorithm ( const AlgorithmSpecification alg_spec,
const DeviceSpecification dev_spec 
)

If the specified operation does not exist, it is created. Multiple calls to addAlgorithm with an AlgorithmSpecification having the same Operation name will add the respective algorithms to the algorithm pool of the specified Operation

Parameters:
alg_specdefines properties of the algorithm, e.g., name, the operation it belongs to, etc.
dev_specdefines properties of the processing device the algorithm runs on, e.g., device type (CPU or GPU) and the device id
Returns:
returns true on success and false otherwise

Definition at line 24 of file scheduler.cpp.

References hype::core::Scheduler::ProcessingDevices::addDevice(), hype::core::Scheduler::ProcessingDevices::exists(), hype::core::AlgorithmSpecification::getAlgorithmName(), hype::core::AlgorithmSpecification::getOperationName(), hype::core::AlgorithmSpecification::getRecomputationHeuristicName(), hype::core::AlgorithmSpecification::getStatisticalMethodName(), hype::core::global_mutex, map_operationname_to_operation_, and proc_devs_.

Here is the call graph for this function:

bool hype::core::Scheduler::addObservation ( const SchedulingDecision sched_dec,
const double &  measured_execution_time 
)
Parameters:
sched_decthe scheduling decision, this observation belongs to
measured_execution_timemeasured execution time, in nanoseconds!!!
Returns:
true on success and false in case an error occured

Definition at line 213 of file scheduler.cpp.

References hype::core::SchedulingDecision::getEstimatedExecutionTimeforAlgorithm(), hype::core::SchedulingDecision::getFeatureValues(), hype::core::SchedulingDecision::getNameofChoosenAlgorithm(), hype::core::global_mutex, map_operationname_to_operation_, proc_devs_, and hype::core::Scheduler::ProcessingDevices::removeSchedulingDecision().

Here is the call graph for this function:

const AlgorithmPtr hype::core::Scheduler::getAlgorithm ( const std::string &  name_of_algorithm)
Parameters:
name_of_algorithmname of the Algorithm where the pointer is requested
Returns:
returns a valid pointer to and Algorithm object on success and a NULL pointer if the requested Algorithm was not found

Definition at line 114 of file scheduler.cpp.

References map_operationname_to_operation_.

Referenced by getEstimatedExecutionTime(), hype::core::Report::getRelativeEstimationError(), setRecomputationHeuristic(), and setStatisticalMethod().

Here is the caller graph for this function:

Parameters:
op_specOperatorSpecification, contains all available information about the operator to execute
dev_constrDeviceConstraint, restricting the available algorithms to a subset of the algorithm pool (e.g., allow only CPU algorithms)
Returns:
SchedulingDecision, which contains the suggested algortihm for the specified information

Definition at line 159 of file scheduler.cpp.

References hype::core::OperatorSpecification::getFeatureVector(), hype::core::OperatorSpecification::getOperatorName(), hype::core::global_mutex, and map_operationname_to_operation_.

Here is the call graph for this function:

Scheduler& hype::core::Scheduler::operator= ( const Scheduler ) [private]
Parameters:
referenceto existing Scheduler object

Definition at line 244 of file scheduler.cpp.

References map_operationname_to_operation_.

Referenced by hype_printStatus().

Here is the caller graph for this function:

bool hype::core::Scheduler::setOptimizationCriterion ( const std::string &  name_of_operation,
const std::string &  name_of_optimization_criterion 
)
Parameters:
name_of_operationname of the Operation
name_of_optimization_criterionName of OptimizationCriterion
Returns:
returns true on success and false otherwise

Definition at line 89 of file scheduler.cpp.

References hype::core::getNewOptimizationCriterionbyName(), hype::core::global_mutex, and map_operationname_to_operation_.

Here is the call graph for this function:

bool hype::core::Scheduler::setRecomputationHeuristic ( const std::string &  name_of_algorithm,
const std::string &  name_of_recomputation_strategy 
)
Parameters:
name_of_algorithmName of Algorithm
name_of_recomputation_strategyassigns the RecomputationHeuristic name_of_recomputation_strategy to an existing Algorithm
Returns:
returns true on success and false otherwise

Definition at line 144 of file scheduler.cpp.

References getAlgorithm(), hype::core::getNewRecomputationHeuristicbyName(), and hype::core::global_mutex.

Here is the call graph for this function:

bool hype::core::Scheduler::setStatisticalMethod ( const std::string &  name_of_algorithm,
const std::string &  name_of_statistical_method 
)
Parameters:
name_of_algorithmName of Algorithm
name_of_statistical_methodassigns the StatisticalMethod name_of_statistical_method to an existing Algorithm
Returns:
returns true on success and false otherwise

Definition at line 127 of file scheduler.cpp.

References getAlgorithm(), hype::core::getNewStatisticalMethodbyName(), and hype::core::global_mutex.

Here is the call graph for this function:


Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines