Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
|
This class represents an algorithm. It abstracts important features and encapsulates information of the algorithm. At the same time, it is highly adaptable. More...
#include <algorithm.hpp>
An algorithm gets assigned three things. First is a statistical method, which dictates an approximation function and takes care of recomputing the approximation function. Second is a recomputation heuristic, which decides, when to recompute an algorithm. Third is a statistic, which stores past observed execution tiems ofthe algorithm together with an abstraction of the input data set in a measurement pair list. This list is implemented by the class stemod::core::AlgorithmStatistics. The algorithm has to update it's statistics every time, a new observation (an instance of class stemod::core::MeasurementPair) is added. Hence, the Algorithm class provides the basis for the decision component, which is done by an optimization_criterion, which is implemented by drived classes of stemod::core::OptimizationCriterion.
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).
Definition at line 49 of file algorithm.hpp.
hype::core::Algorithm::Algorithm | ( | const std::string & | name_of_algorithm, |
const std::string & | name_of_statistical_method, | ||
const std::string & | name_of_recomputation_strategy, | ||
Operation & | operation, | ||
DeviceSpecification | comp_dev | ||
) |
name_of_algorithm | name of the algorithm, it has to be unique! |
name_of_statistical_method | the name of a supported statistical method |
name_of_recomputation_strategy | name of the recomputation strategy |
Definition at line 12 of file algorithm.cpp.
References ptr_recomputation_heristic_, and ptr_statistical_method_.
Definition at line 37 of file algorithm.cpp.
References hype::core::Operation::getName(), hype::core::Runtime_Configuration::instance(), name_, operation_, statistics_, and hype::core::AlgorithmStatistics::writeToDisc().
bool hype::core::Algorithm::addMeasurementPair | ( | const MeasurementPair & | mp | ) |
Definition at line 81 of file algorithm.cpp.
References hype::core::LoadChangeEstimator::add(), hype::core::MeasurementPairRingbuffer::addMeasurementPair(), hype::core::AlgorithmStatistics::executionHistory_, hype::core::MeasurementPair::getEstimatedTime(), hype::core::MeasurementPair::getMeasuredTime(), hype::core::Runtime_Configuration::getRetrainingLength(), hype::core::EstimatedTime::getTimeinNanoseconds(), hype::core::MeasuredTime::getTimeinNanoseconds(), hype::core::Runtime_Configuration::instance(), inTrainingPhase(), is_in_retraining_phase_, load_change_estimator_, name_, hype::core::AlgorithmStatistics::number_of_recomputations_, hype::core::AlgorithmStatistics::number_of_terminated_executions_of_this_algorithm_, ptr_recomputation_heristic_, ptr_statistical_method_, quiet, hype::core::AlgorithmStatistics::relative_errors_, retraining_length_, statistics_, hype::core::AlgorithmStatistics::total_execution_time_, and verbose.
Definition at line 82 of file algorithm.hpp.
References statistics_.
Referenced by hype::core::Least_Squares_Method_1D::recomuteApproximationFunction(), and hype::core::Least_Squares_Method_2D::recomuteApproximationFunction().
const DeviceSpecification hype::core::Algorithm::getDeviceSpecification | ( | ) | const throw () |
Definition at line 163 of file algorithm.cpp.
References comp_dev_.
Referenced by hype::core::SchedulingDecision::getDeviceSpecification().
const EstimatedTime hype::core::Algorithm::getEstimatedExecutionTime | ( | const Tuple & | input_values | ) |
Definition at line 121 of file algorithm.cpp.
References ptr_statistical_method_.
const LoadChangeEstimator & hype::core::Algorithm::getLoadChangeEstimator | ( | ) | const throw () |
Definition at line 159 of file algorithm.cpp.
References load_change_estimator_.
const std::string hype::core::Algorithm::getName | ( | ) | const |
Definition at line 77 of file algorithm.cpp.
References name_.
Referenced by hype::core::SchedulingDecision::getNameofChoosenAlgorithm(), hype::core::Oneshotcomputation::internal_recompute(), hype::core::PeriodicRecomputation::internal_recompute(), hype::core::RelativeErrorBasedRecomputation::internal_recompute(), and hype::core::RecomputationHeuristic_Internal::recompute().
unsigned int hype::core::Algorithm::getNumberOfDecisionsforThisAlgorithm | ( | ) | const throw () |
Definition at line 125 of file algorithm.cpp.
References hype::core::AlgorithmStatistics::number_of_decisions_for_this_algorithm_, and statistics_.
unsigned int hype::core::Algorithm::getNumberOfTerminatedExecutions | ( | ) | const throw () |
Definition at line 129 of file algorithm.cpp.
References hype::core::AlgorithmStatistics::number_of_terminated_executions_of_this_algorithm_, and statistics_.
uint64_t hype::core::Algorithm::getTimeOfLastExecution | ( | ) | const throw () |
Definition at line 138 of file algorithm.cpp.
References logical_timestamp_of_last_execution_.
double hype::core::Algorithm::getTotalExecutionTime | ( | ) | const throw () |
Definition at line 134 of file algorithm.cpp.
References statistics_, and hype::core::AlgorithmStatistics::total_execution_time_.
void hype::core::Algorithm::incrementNumberofDecisionsforThisAlgorithm | ( | ) | throw () |
Definition at line 146 of file algorithm.cpp.
References hype::core::AlgorithmStatistics::number_of_decisions_for_this_algorithm_, and statistics_.
Referenced by hype::core::SchedulingDecision::SchedulingDecision().
bool hype::core::Algorithm::inRetrainingPhase | ( | ) | const throw () |
bool hype::core::Algorithm::inTrainingPhase | ( | ) | const throw () |
Definition at line 56 of file algorithm.cpp.
References ptr_statistical_method_.
Referenced by addMeasurementPair().
void hype::core::Algorithm::retrain | ( | ) |
Definition at line 150 of file algorithm.cpp.
References is_in_retraining_phase_, name_, quiet, and retraining_length_.
bool hype::core::Algorithm::setRecomputationHeuristic | ( | std::tr1::shared_ptr< RecomputationHeuristic_Internal > | ptr_recomp_heuristic | ) |
Definition at line 64 of file algorithm.cpp.
References ptr_recomputation_heristic_.
bool hype::core::Algorithm::setStatisticalMethod | ( | std::tr1::shared_ptr< StatisticalMethod_Internal > | ptr_statistical_method | ) |
Definition at line 44 of file algorithm.cpp.
References ptr_statistical_method_.
void hype::core::Algorithm::setTimeOfLastExecution | ( | uint64_t | new_timestamp | ) | throw () |
Definition at line 142 of file algorithm.cpp.
Definition at line 114 of file algorithm.hpp.
Referenced by getDeviceSpecification().
bool hype::core::Algorithm::is_in_retraining_phase_ [private] |
Definition at line 111 of file algorithm.hpp.
Referenced by addMeasurementPair(), inRetrainingPhase(), and retrain().
Definition at line 113 of file algorithm.hpp.
Referenced by addMeasurementPair(), and getLoadChangeEstimator().
uint64_t hype::core::Algorithm::logical_timestamp_of_last_execution_ [private] |
Definition at line 110 of file algorithm.hpp.
Referenced by getTimeOfLastExecution().
std::string hype::core::Algorithm::name_ [private] |
Definition at line 105 of file algorithm.hpp.
Referenced by addMeasurementPair(), getName(), retrain(), and ~Algorithm().
Operation& hype::core::Algorithm::operation_ [private] |
Definition at line 109 of file algorithm.hpp.
Referenced by ~Algorithm().
std::tr1::shared_ptr<RecomputationHeuristic_Internal> hype::core::Algorithm::ptr_recomputation_heristic_ [private] |
Definition at line 107 of file algorithm.hpp.
Referenced by addMeasurementPair(), Algorithm(), and setRecomputationHeuristic().
std::tr1::shared_ptr<StatisticalMethod_Internal> hype::core::Algorithm::ptr_statistical_method_ [private] |
Definition at line 106 of file algorithm.hpp.
Referenced by addMeasurementPair(), Algorithm(), getEstimatedExecutionTime(), inTrainingPhase(), and setStatisticalMethod().
unsigned int hype::core::Algorithm::retraining_length_ [private] |
Definition at line 112 of file algorithm.hpp.
Referenced by addMeasurementPair(), and retrain().
Definition at line 108 of file algorithm.hpp.
Referenced by addMeasurementPair(), getAlgorithmStatistics(), getNumberOfDecisionsforThisAlgorithm(), getNumberOfTerminatedExecutions(), getTotalExecutionTime(), incrementNumberofDecisionsforThisAlgorithm(), and ~Algorithm().