Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
hype.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <config/global_definitions.hpp>
#include <assert.h>
Include dependency graph for hype.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  C_SchedulingDecision
struct  C_AlgorithmSpecification
struct  C_DeviceSpecification
struct  C_OperatorSpecification
struct  C_DeviceConstraint

Functions

char * hype_SchedulingDecision_getAlgorithmName (C_SchedulingDecision *sched_dec)
ProcessingDeviceID hype_SchedulingDecision_getProcessingDeviceID (C_SchedulingDecision *sched_dec)
int hype_deleteSchedulingDecision (C_SchedulingDecision *sched_dec)
C_AlgorithmSpecificationhype_createAlgorithmSpecification (const char *alg_name, const char *op_name, StatisticalMethod stat_meth, RecomputationHeuristic recomp_heur, OptimizationCriterion opt_crit)
 constructs an C_AlgorithmSpecification object by assigning necessary informations to all fields of the object
int hype_deleteAlgorithmSpecification (C_AlgorithmSpecification *alg_spec)
C_DeviceSpecificationhype_createDeviceSpecification (ProcessingDeviceID pd, ProcessingDeviceType pd_t, ProcessingDeviceMemoryID pd_m)
 constructs an C_DeviceSpecification object by assigning necessary informations to all fields of the object
int hype_deleteDeviceSpecification (C_DeviceSpecification *dev_spec)
C_OperatorSpecificationhype_create_OperatorSpecification (const char *operator_name, double *feature_vector, size_t feature_vector_length, ProcessingDeviceMemoryID location_of_input_data, ProcessingDeviceMemoryID location_for_output_data)
 constructs an C_OperatorSpecification object by assigning necessary informations to all fields of the object
int hype_deleteOperatorSpecification (C_OperatorSpecification *op_spec)
C_DeviceConstrainthype_createDeviceConstraint (DeviceTypeConstraint dev_constr, ProcessingDeviceMemoryID pd_mem_constr)
 constructs an C_DeviceConstraint object by assigning necessary informations to all fields of the object
int hype_deleteDeviceConstraint (C_DeviceConstraint *dev_const)
int hype_addAlgorithm (const C_AlgorithmSpecification *alg_spec, const C_DeviceSpecification *dev_spec)
 adds an Algorithm to the AlgorithmPool of an operation defined by alg_spec on the processing device defined by dev_spec.
int hype_setOptimizationCriterion (const char *name_of_operation, const char *name_of_optimization_criterion)
 assigns the OptimizationCriterion name_of_optimization_criterion to Operation name_of_operation
int hype_setStatisticalMethod (const char *name_of_algorithm, const char *name_of_statistical_method)
 assigns the StatisticalMethod name_of_statistical_method to an existing Algorithm
int hype_setRecomputationHeuristic (const char *name_of_algorithm, const char *name_of_recomputation_strategy)
 assigns the StatisticalMethod name_of_statistical_method to an existing Algorithm
C_SchedulingDecisionhype_getOptimalAlgorithm (const C_OperatorSpecification *op_spec, const C_DeviceConstraint *dev_constr)
 Returns a Scheduling Decision, which contains the name of the estimated optimal Algorithm w.r.t. the user specified optimization criterion.
int hype_addObservation (const C_SchedulingDecision *sched_dec, const double measured_execution_time)
 adds an observed execution time to the algorithm previously choosen by getOptimalAlgorithmName.
double hype_getEstimatedExecutionTime (const C_OperatorSpecification *op_spec, const char *alg_name)
uint64_t hype_getTimestamp ()
void hype_printStatus ()

Function Documentation

int hype_addAlgorithm ( const C_AlgorithmSpecification alg_spec,
const C_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 163 of file c_interface.cpp.

References hype::Scheduler::instance(), C_AlgorithmSpecification::ptr, and C_DeviceSpecification::ptr.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int hype_addObservation ( const C_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 211 of file c_interface.cpp.

References hype::Scheduler::instance(), and C_SchedulingDecision::ptr.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

C_OperatorSpecification* hype_create_OperatorSpecification ( const char *  operator_name,
double *  feature_vector,
size_t  feature_vector_length,
ProcessingDeviceMemoryID  location_of_input_data,
ProcessingDeviceMemoryID  location_for_output_data 
)
Parameters:
operator_namethe operations's name
feature_vectorthe feature vector of this operator
feature_vector_lengththe feature vectors length
location_of_input_datathe memory id where the input data is stored
location_for_output_datathe memory id where the output data is stored

Definition at line 114 of file c_interface.cpp.

References C_OperatorSpecification::ptr.

Referenced by main().

Here is the caller graph for this function:

C_AlgorithmSpecification* hype_createAlgorithmSpecification ( const char *  alg_name,
const char *  op_name,
StatisticalMethod  stat_meth,
RecomputationHeuristic  recomp_heur,
OptimizationCriterion  opt_crit 
)
Parameters:
alg_namename of the algorithm
op_namename of the operation the algorithms belongs to
stat_meththe statistical method used for learning the algorithms behavior (optional)
recomp_heurthe recomputation heuristic used for adapting the algorithms approximation function (optional)
opt_critthe optimization criterion of the operation the algorithm belongs to (optional)

Definition at line 65 of file c_interface.cpp.

References C_AlgorithmSpecification::ptr.

Referenced by main().

Here is the caller graph for this function:

Parameters:
dev_constra device type constraint (e.g., CPU_ONLY or ANY_DEVICE for now restriction)
pd_mem_constrmemory id, where the data should be stored when processed (experimental)

Definition at line 140 of file c_interface.cpp.

References C_DeviceConstraint::ptr.

Referenced by main().

Here is the caller graph for this function:

Parameters:
pdthe unique id of the processing device
pd_ttype of the processing device (e.g., CPU or GPU)
pd_munique id of the memory the processing device uses

Definition at line 90 of file c_interface.cpp.

References C_DeviceSpecification::ptr.

Referenced by main().

Here is the caller graph for this function:

Definition at line 77 of file c_interface.cpp.

References C_AlgorithmSpecification::ptr.

Referenced by main().

Here is the caller graph for this function:

Definition at line 148 of file c_interface.cpp.

References C_DeviceConstraint::ptr.

Referenced by main().

Here is the caller graph for this function:

Definition at line 100 of file c_interface.cpp.

References C_DeviceSpecification::ptr.

Referenced by main().

Here is the caller graph for this function:

Definition at line 125 of file c_interface.cpp.

References C_OperatorSpecification::ptr.

Referenced by main().

Here is the caller graph for this function:

Definition at line 52 of file c_interface.cpp.

References C_SchedulingDecision::ptr.

Referenced by main().

Here is the caller graph for this function:

double hype_getEstimatedExecutionTime ( const C_OperatorSpecification op_spec,
const char *  alg_name 
)
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 196 of file c_interface.cpp.

References hype::Scheduler::getOptimalAlgorithm(), hype::Scheduler::instance(), C_SchedulingDecision::ptr, C_OperatorSpecification::ptr, and C_DeviceConstraint::ptr.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t hype_getTimestamp ( )

Definition at line 230 of file c_interface.cpp.

References getTimestamp().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void hype_printStatus ( )

Definition at line 234 of file c_interface.cpp.

References hype::core::Scheduler::instance(), and hype::core::Scheduler::print().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 34 of file c_interface.cpp.

References hype::core::SchedulingDecision::getNameofChoosenAlgorithm(), and C_SchedulingDecision::ptr.

Here is the call graph for this function:

int hype_setOptimizationCriterion ( const char *  name_of_operation,
const char *  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 173 of file c_interface.cpp.

References hype::Scheduler::instance().

Here is the call graph for this function:

int hype_setRecomputationHeuristic ( const char *  name_of_algorithm,
const char *  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 187 of file c_interface.cpp.

References hype::Scheduler::instance().

Here is the call graph for this function:

int hype_setStatisticalMethod ( const char *  name_of_algorithm,
const char *  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 180 of file c_interface.cpp.

References hype::Scheduler::instance().

Here is the call graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines