Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Code Structure

Pavlo Shevchenko edited this page Aug 23, 2019 · 3 revisions

Entry Point

src/hybrid/run.cpp: this is the entry point for the experiments. To evaluate additional queries, add them to: ::unordered_set<std::string> q = {"1h", "1v", "1hv", "6h", "6v", "6hv", "18h", "18v", "18hv"};. This program will firstly compile the API header used by the Hyper code. Then, for each query it will compile the LLVM code if necessary, and run selected queries.

Query Processing Algorithms

src/benchmark/tpch/queries/qNUMBER.cpp: in these files, you'll find the algorithms for processing queries using Hyper, Vectorwise or a combination of both. Furthermore, in the same file, in function getQuery() you'll find the declaration of Vectorwise pipeline.

include/benchmark/tpch/Queries.hpp: new queries or new algorithms (e.g. hybrid execution for a new query) can be declared here. Once this is done, you can create a new .cpp or extend the existing one in src/benchmark/tpch/queries.

Code Generation

include(src)/hybrid/code_generator.hpp(.cpp): contains functionality for generating Hyper code for TPC-H queries. At the moment, it is pretty useless and just writes the complete code into a .cpp-file. However, it can be extended to a complete code generation functionality. Refer to cpp_code_generator from Hawk-VLDBJ repository for an example.

Code Compilation

include(src)/hybrid/compilation_engine.hpp(.cpp): contains functionality for compiling API header and cpp-code into a shared library. It provides two options for creating the shared library: from cpp to object files and then into shared library, or from cpp to LLVM code and then into shared library. We use clang compiler to create LLVM code. The implementation is motivated by Hawk-VLDBJ.

Relevant Data and Function Definitions

include/hybrid/hybrid_datatypes.hpp: contains definitions of several custom datatypes (e.g. signatures of compiled Hyper functions and help-structures for interpretation of Vectorwise data).

Exception Handling

include(src)/hybrid/hybrid_exception.hpp(.cpp): custom exception to differentiate between issues caused by hybrid approaches and remaining functionality. Technically, it is a simple runtime exception with custom message.

API Header

include/hybrid/minimal_api.hpp: in order to speed up the compilation of hyper code, we use the concept of pre-compiled headers. Therefore, in this file we declare all dependencies of the compiled code and pre-compile this header before the first execution.

Shared Library

include(src)/hybrid/shared_library.hpp(.cpp): a wrapper around dlfcn that simplifies the usage of shared libraries.