Column-oriented GPU-accelerated Database Management System
CoGaDB
|
The Scheduler is the central component for interaction of the application and the library. More...
#include <hype.hpp>
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. | |
core::EstimatedTime | getEstimatedExecutionTime (const OperatorSpecification &op_spec, const std::string &alg_name) |
Static Public Member Functions | |
static Scheduler & | instance () |
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. | |
Scheduler & | operator= (const Scheduler &s) |
Copy assignment operator is private to avoid copying of the single instance of Scheduler. |
The Scheduler is the central component for interaction of the application and the library.
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). This class is the interface for using stemod. It forwards calls to the Scheduler in stemod::core and implements thread safety.
hype::Scheduler::Scheduler | ( | ) | [private] |
Constructor is private to avoid multiple instances of Scheduler.
hype::Scheduler::Scheduler | ( | const Scheduler & | ) | [private] |
bool hype::Scheduler::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.
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
alg_spec | defines properties of the algorithm, e.g., name, the operation it belongs to, etc. |
dev_spec | defines properties of the processing device the algorithm runs on, e.g., device type (CPU or GPU) and the device id |
Referenced by CoGaDB::query_processing::physical_operator::map_init_function_addconstantvaluecolumn_operator(), CoGaDB::query_processing::physical_operator::map_init_function_column_algebra_operator(), CoGaDB::query_processing::physical_operator::map_init_function_column_constant_filter_operator(), CoGaDB::query_processing::physical_operator::map_init_function_column_constant_operator(), CoGaDB::query_processing::physical_operator::map_init_function_column_scan_operator(), CoGaDB::query_processing::physical_operator::map_init_function_complex_selection_operator(), CoGaDB::query_processing::physical_operator::map_init_function_cpu_column_algebra_operator(), CoGaDB::query_processing::physical_operator::map_init_function_cpu_column_comparison_operator(), CoGaDB::query_processing::physical_operator::map_init_function_cpu_positionlist_operator(), CoGaDB::query_processing::physical_operator::map_init_function_crossjoin_operator(), CoGaDB::query_processing::physical_operator::map_init_function_groupby_operator(), CoGaDB::query_processing::physical_operator::map_init_function_join_operator(), CoGaDB::query_processing::physical_operator::map_init_function_projection_operator(), CoGaDB::query_processing::physical_operator::map_init_function_scan_operator(), CoGaDB::query_processing::physical_operator::map_init_function_selection_operator(), and CoGaDB::query_processing::physical_operator::map_init_function_sort_operator().
bool hype::Scheduler::addObservation | ( | const SchedulingDecision & | sched_dec, |
const double & | measured_execution_time | ||
) |
adds an observed execution time to the algorithm previously choosen by getOptimalAlgorithmName.
sched_dec | the scheduling decision, this observation belongs to |
measured_execution_time | measured execution time, in nanoseconds!!! |
core::EstimatedTime hype::Scheduler::getEstimatedExecutionTime | ( | const OperatorSpecification & | op_spec, |
const std::string & | alg_name | ||
) |
const SchedulingDecision hype::Scheduler::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.
op_spec | OperatorSpecification, contains all available information about the operator to execute |
dev_constr | DeviceConstraint, restricting the available algorithms to a subset of the algorithm pool (e.g., allow only CPU algorithms) |
Referenced by hype::queryprocessing::OperatorMapper< TablePtr, function >::getPhysicalOperator().
static Scheduler& hype::Scheduler::instance | ( | ) | [static] |
This method implements the singelton concept for the Scheduler class to avoid multiple instances.
Referenced by hype::queryprocessing::OperatorMapper< TablePtr, function >::getPhysicalOperator(), CoGaDB::query_processing::physical_operator::map_init_function_addconstantvaluecolumn_operator(), CoGaDB::query_processing::physical_operator::map_init_function_column_algebra_operator(), CoGaDB::query_processing::physical_operator::map_init_function_column_constant_filter_operator(), CoGaDB::query_processing::physical_operator::map_init_function_column_constant_operator(), CoGaDB::query_processing::physical_operator::map_init_function_column_scan_operator(), CoGaDB::query_processing::physical_operator::map_init_function_complex_selection_operator(), CoGaDB::query_processing::physical_operator::map_init_function_cpu_column_algebra_operator(), CoGaDB::query_processing::physical_operator::map_init_function_cpu_column_comparison_operator(), CoGaDB::query_processing::physical_operator::map_init_function_cpu_positionlist_operator(), CoGaDB::query_processing::physical_operator::map_init_function_crossjoin_operator(), CoGaDB::query_processing::physical_operator::map_init_function_groupby_operator(), CoGaDB::query_processing::physical_operator::map_init_function_join_operator(), CoGaDB::query_processing::physical_operator::map_init_function_projection_operator(), CoGaDB::query_processing::physical_operator::map_init_function_scan_operator(), CoGaDB::query_processing::physical_operator::map_init_function_selection_operator(), CoGaDB::query_processing::physical_operator::map_init_function_sort_operator(), and hype::queryprocessing::Operation_Benchmark< Type >::setup().
bool hype::Scheduler::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
name_of_operation | name of the Operation |
name_of_optimization_criterion | Name of OptimizationCriterion |
bool hype::Scheduler::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
name_of_algorithm | Name of Algorithm |
name_of_recomputation_strategy | assigns the RecomputationHeuristic name_of_recomputation_strategy to an existing Algorithm |
bool hype::Scheduler::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
name_of_algorithm | Name of Algorithm |
name_of_statistical_method | assigns the StatisticalMethod name_of_statistical_method to an existing Algorithm |