OmniSciDB
a5dc49c757
|
#include <Execute.h>
Classes | |
class | CgenStateManager |
struct | ExecutorMutexHolder |
class | FetchCacheAnchor |
struct | GroupColLLVMValue |
struct | JoinHashTableOrError |
Public Types | |
enum | ExtModuleKinds { ExtModuleKinds::template_module, ExtModuleKinds::udf_cpu_module, ExtModuleKinds::udf_gpu_module, ExtModuleKinds::rt_udf_cpu_module, ExtModuleKinds::rt_udf_gpu_module, ExtModuleKinds::rt_geos_module, ExtModuleKinds::rt_libdevice_module } |
using | ExecutorId = size_t |
using | CachedCardinality = std::pair< bool, size_t > |
Public Member Functions | |
Executor (const ExecutorId id, Data_Namespace::DataMgr *data_mgr, const size_t block_size_x, const size_t grid_size_x, const size_t max_gpu_slab_size, const std::string &debug_dir, const std::string &debug_file) | |
void | clearCaches (bool runtime_only=false) |
std::string | dumpCache () const |
void | reset (bool discard_runtime_modules_only=false) |
const std::unique_ptr < llvm::Module > & | get_rt_module () const |
const std::unique_ptr < llvm::Module > & | get_udf_module (bool is_gpu=false) const |
const std::unique_ptr < llvm::Module > & | get_rt_udf_module (bool is_gpu=false) const |
const std::unique_ptr < llvm::Module > & | get_geos_module () const |
const std::unique_ptr < llvm::Module > & | get_libdevice_module () const |
bool | has_rt_module () const |
bool | has_udf_module (bool is_gpu=false) const |
bool | has_rt_udf_module (bool is_gpu=false) const |
bool | has_geos_module () const |
bool | has_libdevice_module () const |
const TemporaryTables * | getTemporaryTables () |
StringDictionaryProxy * | getStringDictionaryProxy (const shared::StringDictKey &dict_key, const bool with_generation) const |
StringDictionaryProxy * | getStringDictionaryProxy (const shared::StringDictKey &dict_key, const std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const bool with_generation) const |
const StringDictionaryProxy::IdMap * | getStringProxyTranslationMap (const shared::StringDictKey &source_dict_key, const shared::StringDictKey &dest_dict_key, const RowSetMemoryOwner::StringTranslationType translation_type, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos, std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const bool with_generation) const |
const StringDictionaryProxy::IdMap * | getJoinIntersectionStringProxyTranslationMap (const StringDictionaryProxy *source_proxy, StringDictionaryProxy *dest_proxy, const std::vector< StringOps_Namespace::StringOpInfo > &source_string_op_infos, const std::vector< StringOps_Namespace::StringOpInfo > &dest_source_string_op_infos, std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner) const |
const StringDictionaryProxy::TranslationMap < Datum > * | getStringProxyNumericTranslationMap (const shared::StringDictKey &source_dict_key, const std::vector< StringOps_Namespace::StringOpInfo > &string_op_infos, std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const bool with_generation) const |
bool | isCPUOnly () const |
bool | isArchMaxwell (const ExecutorDeviceType dt) const |
bool | containsLeftDeepOuterJoin () const |
const ColumnDescriptor * | getColumnDescriptor (const Analyzer::ColumnVar *) const |
const ColumnDescriptor * | getPhysicalColumnDescriptor (const Analyzer::ColumnVar *, int) const |
Data_Namespace::DataMgr * | getDataMgr () const |
const std::shared_ptr < RowSetMemoryOwner > | getRowSetMemoryOwner () const |
const TemporaryTables * | getTemporaryTables () const |
Fragmenter_Namespace::TableInfo | getTableInfo (const shared::TableKey &table_key) const |
const TableGeneration & | getTableGeneration (const shared::TableKey &table_key) const |
ExpressionRange | getColRange (const PhysicalInput &) const |
size_t | getNumBytesForFetchedRow (const std::set< shared::TableKey > &table_keys_to_fetch) const |
std::map< shared::ColumnKey, size_t > | getColumnByteWidthMap (const std::set< shared::TableKey > &table_ids_to_fetch, const bool include_lazy_fetched_cols) const |
size_t | getNumBytesForFetchedRow (const std::set< int > &table_ids_to_fetch) const |
ExecutorResourceMgr_Namespace::ChunkRequestInfo | getChunkRequestInfo (const ExecutorDeviceType device_type, const std::vector< InputDescriptor > &input_descs, const std::vector< InputTableInfo > &query_infos, const std::vector< std::pair< int32_t, FragmentsList >> &device_fragment_lists) const |
Determines a unique list of chunks and their associated byte sizes for a given query plan. More... | |
bool | hasLazyFetchColumns (const std::vector< Analyzer::Expr * > &target_exprs) const |
std::vector< ColumnLazyFetchInfo > | getColLazyFetchInfo (const std::vector< Analyzer::Expr * > &target_exprs) const |
void | interrupt (const QuerySessionId &query_session="", const QuerySessionId &interrupt_session="") |
void | resetInterrupt () |
void | enableRuntimeQueryInterrupt (const double runtime_query_check_freq, const unsigned pending_query_check_freq) const |
int8_t | warpSize () const |
unsigned | gridSize () const |
void | setGridSize (unsigned grid_size) |
void | resetGridSize () |
unsigned | numBlocksPerMP () const |
unsigned | blockSize () const |
void | setBlockSize (unsigned block_size) |
void | resetBlockSize () |
size_t | maxGpuSlabSize () const |
ResultSetPtr | executeWorkUnit (size_t &max_groups_buffer_entry_guess, const bool is_agg, const std::vector< InputTableInfo > &, const RelAlgExecutionUnit &, const CompilationOptions &, const ExecutionOptions &options, RenderInfo *render_info, const bool has_cardinality_estimation, ColumnCacheMap &column_cache) |
TableUpdateMetadata | executeUpdate (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< InputTableInfo > &table_infos, const TableDescriptor *updated_table_desc, const CompilationOptions &co, const ExecutionOptions &eo, const Catalog_Namespace::Catalog &cat, std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const UpdateLogForFragment::Callback &cb, const bool is_agg) |
void | addTransientStringLiterals (const RelAlgExecutionUnit &ra_exe_unit, const std::shared_ptr< RowSetMemoryOwner > &row_set_mem_owner) |
int | deviceCount (const ExecutorDeviceType) const |
void | logSystemCPUMemoryStatus (std::string const &tag, size_t const thread_idx) const |
void | logSystemGPUMemoryStatus (std::string const &tag, size_t const thread_idx) const |
void | setupCaching (const std::unordered_set< PhysicalInput > &phys_inputs, const std::unordered_set< shared::TableKey > &phys_table_keys) |
void | setColRangeCache (const AggregatedColRange &aggregated_col_range) |
ExecutorId | getExecutorId () const |
QuerySessionId & | getCurrentQuerySession (heavyai::shared_lock< heavyai::shared_mutex > &read_lock) |
QuerySessionStatus::QueryStatus | getQuerySessionStatus (const QuerySessionId &candidate_query_session, heavyai::shared_lock< heavyai::shared_mutex > &read_lock) |
bool | checkCurrentQuerySession (const std::string &candidate_query_session, heavyai::shared_lock< heavyai::shared_mutex > &read_lock) |
void | invalidateRunningQuerySession (heavyai::unique_lock< heavyai::shared_mutex > &write_lock) |
bool | addToQuerySessionList (const QuerySessionId &query_session, const std::string &query_str, const std::string &submitted, const size_t executor_id, const QuerySessionStatus::QueryStatus query_status, heavyai::unique_lock< heavyai::shared_mutex > &write_lock) |
bool | removeFromQuerySessionList (const QuerySessionId &query_session, const std::string &submitted_time_str, heavyai::unique_lock< heavyai::shared_mutex > &write_lock) |
void | setQuerySessionAsInterrupted (const QuerySessionId &query_session, heavyai::unique_lock< heavyai::shared_mutex > &write_lock) |
bool | checkIsQuerySessionInterrupted (const std::string &query_session, heavyai::shared_lock< heavyai::shared_mutex > &read_lock) |
bool | checkIsQuerySessionEnrolled (const QuerySessionId &query_session, heavyai::shared_lock< heavyai::shared_mutex > &read_lock) |
bool | updateQuerySessionStatusWithLock (const QuerySessionId &query_session, const std::string &submitted_time_str, const QuerySessionStatus::QueryStatus updated_query_status, heavyai::unique_lock< heavyai::shared_mutex > &write_lock) |
bool | updateQuerySessionExecutorAssignment (const QuerySessionId &query_session, const std::string &submitted_time_str, const size_t executor_id, heavyai::unique_lock< heavyai::shared_mutex > &write_lock) |
std::vector< QuerySessionStatus > | getQuerySessionInfo (const QuerySessionId &query_session, heavyai::shared_lock< heavyai::shared_mutex > &read_lock) |
heavyai::shared_mutex & | getSessionLock () |
CurrentQueryStatus | attachExecutorToQuerySession (const QuerySessionId &query_session_id, const std::string &query_str, const std::string &query_submitted_time) |
void | checkPendingQueryStatus (const QuerySessionId &query_session) |
void | clearQuerySessionStatus (const QuerySessionId &query_session, const std::string &submitted_time_str) |
void | updateQuerySessionStatus (const QuerySessionId &query_session, const std::string &submitted_time_str, const QuerySessionStatus::QueryStatus new_query_status) |
void | enrollQuerySession (const QuerySessionId &query_session, const std::string &query_str, const std::string &submitted_time_str, const size_t executor_id, const QuerySessionStatus::QueryStatus query_session_status) |
size_t | getNumCurentSessionsEnrolled () const |
const std::vector< size_t > | getExecutorIdsRunningQuery (const QuerySessionId &interrupt_session) const |
bool | checkNonKernelTimeInterrupted () const |
void | registerExtractedQueryPlanDag (const QueryPlanDAG &query_plan_dag) |
const QueryPlanDAG | getLatestQueryPlanDagExtracted () const |
void | addToCardinalityCache (const CardinalityCacheKey &cache_key, const size_t cache_value) |
CachedCardinality | getCachedCardinality (const CardinalityCacheKey &cache_key) |
heavyai::shared_mutex & | getDataRecyclerLock () |
QueryPlanDagCache & | getQueryPlanDagCache () |
ResultSetRecyclerHolder & | getResultSetRecyclerHolder () |
CgenState * | getCgenStatePtr () const |
PlanState * | getPlanStatePtr () const |
llvm::LLVMContext & | getContext () |
void | update_extension_modules (bool update_runtime_modules_only=false) |
Static Public Member Functions | |
static void | clearExternalCaches (bool for_update, const TableDescriptor *td, const int current_db_id) |
template<typename F > | |
static void | registerExtensionFunctions (F register_extension_functions) |
static std::shared_ptr< Executor > | getExecutor (const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters()) |
static void | nukeCacheOfExecutors () |
static void | clearMemory (const Data_Namespace::MemoryLevel memory_level) |
static size_t | getArenaBlockSize () |
static void | addUdfIrToModule (const std::string &udf_ir_filename, const bool is_cuda_ir) |
static void | initialize_extension_module_sources () |
static void | registerActiveModule (void *module, const int device_id) |
static void | unregisterActiveModule (const int device_id) |
static std::pair< int64_t, int32_t > | reduceResults (const SQLAgg agg, const SQLTypeInfo &ti, const int64_t agg_init_val, const int8_t out_byte_width, const int64_t *out_vec, const size_t out_vec_sz, const bool is_group_by, const bool float_argument_input) |
static void | clearCardinalityCache () |
static void | invalidateCardinalityCacheForTable (const shared::TableKey &table_key) |
static void | update_after_registration (bool update_runtime_modules_only=false) |
static void | init_resource_mgr (const size_t num_cpu_slots, const size_t num_gpu_slots, const size_t cpu_result_mem, const size_t cpu_buffer_pool_mem, const size_t gpu_buffer_pool_mem, const double per_query_max_cpu_slots_ratio, const double per_query_max_cpu_result_mem_ratio, const bool allow_cpu_kernel_concurrency, const bool allow_cpu_gpu_kernel_concurrency, const bool allow_cpu_slot_oversubscription_concurrency, const bool allow_cpu_result_mem_oversubscription, const double max_available_resource_use_ratio) |
static void | pause_executor_queue () |
static void | resume_executor_queue () |
static size_t | get_executor_resource_pool_total_resource_quantity (const ExecutorResourceMgr_Namespace::ResourceType resource_type) |
static ExecutorResourceMgr_Namespace::ResourcePoolInfo | get_executor_resource_pool_info () |
static void | set_executor_resource_pool_resource (const ExecutorResourceMgr_Namespace::ResourceType resource_type, const size_t resource_quantity) |
static size_t | getBaselineThreshold (bool for_count_distinct, ExecutorDeviceType device_type) |
static const ExecutorResourceMgr_Namespace::ConcurrentResourceGrantPolicy | get_concurrent_resource_grant_policy (const ExecutorResourceMgr_Namespace::ResourceType resource_type) |
static void | set_concurrent_resource_grant_policy (const ExecutorResourceMgr_Namespace::ConcurrentResourceGrantPolicy &concurrent_resource_grant_policy) |
Public Attributes | |
std::mutex | compilation_mutex_ |
Static Public Attributes | |
static constexpr ExecutorId | UNITARY_EXECUTOR_ID = 0 |
static constexpr ExecutorId | INVALID_EXECUTOR_ID = SIZE_MAX |
static std::map < ExtModuleKinds, std::string > | extension_module_sources |
static std::mutex | register_runtime_extension_functions_mutex_ |
static std::mutex | kernel_mutex_ |
static const size_t | auto_cpu_mem_bytes {size_t(0)} |
static std::shared_ptr < ExecutorResourceMgr_Namespace::ExecutorResourceMgr > | executor_resource_mgr_ = nullptr |
Private Types | |
using | PerFragmentCallBack = std::function< void(ResultSetPtr, const Fragmenter_Namespace::FragmentInfo &)> |
Private Member Functions | |
void | clearMetaInfoCache () |
int | deviceCountForMemoryLevel (const Data_Namespace::MemoryLevel memory_level) const |
llvm::Value * | codegenWindowFunction (const size_t target_index, const CompilationOptions &co) |
llvm::Value * | codegenConditionalAggregateCondValSelector (llvm::Value *cond_lv, SQLAgg const aggKind, CompilationOptions const &co) const |
llvm::Value * | codegenWindowFunctionAggregate (CodeGenerator *code_generator, const CompilationOptions &co) |
std::pair< llvm::BasicBlock *, llvm::Value * > | codegenWindowResetStateControlFlow (CodeGenerator *code_generator, const CompilationOptions &co) |
void | codegenWindowFunctionStateInit (CodeGenerator *code_generator, const CompilationOptions &co, llvm::Value *aggregate_state) |
llvm::Value * | codegenWindowFunctionAggregateCalls (llvm::Value *aggregate_state, const CompilationOptions &co) |
llvm::Value * | codegenWindowNavigationFunctionOnFrame (const CompilationOptions &co) |
llvm::Value * | codegenCurrentPartitionIndex (const WindowFunctionContext *window_func_context, CodeGenerator *code_generator, const CompilationOptions &co, llvm::Value *current_row_pos_lv) |
llvm::Value * | codegenFrameBoundExpr (const Analyzer::WindowFunction *window_func, const Analyzer::WindowFrame *frame_bound, CodeGenerator &code_generator, const CompilationOptions &co) |
llvm::Value * | codegenFrameBound (bool for_start_bound, bool for_range_mode, bool for_window_frame_naviation, const Analyzer::WindowFrame *frame_bound, bool is_timestamp_type_frame, llvm::Value *order_key_null_val, const WindowFrameBoundFuncArgs &args) |
std::pair< std::string, llvm::Value * > | codegenLoadOrderKeyBufPtr (WindowFunctionContext *window_func_context, CodeGenerator *code_generator, const CompilationOptions &co) const |
std::pair< llvm::Value *, llvm::Value * > | codegenFrameNullRange (WindowFunctionContext *window_func_context, CodeGenerator *code_generator, const CompilationOptions &co, llvm::Value *partition_index_lv) const |
WindowPartitionBufferPtrs | codegenLoadPartitionBuffers (WindowFunctionContext *window_func_context, CodeGenerator *code_generator, const CompilationOptions &co, llvm::Value *partition_index_lv) const |
std::pair< llvm::Value *, llvm::Value * > | codegenWindowFrameBounds (WindowFunctionContext *window_func_context, const Analyzer::WindowFrame *frame_start_bound, const Analyzer::WindowFrame *frame_end_bound, llvm::Value *order_key_col_null_val_lv, WindowFrameBoundFuncArgs &args, CodeGenerator &code_generator) |
std::pair< llvm::Value *, llvm::Value * > | codegenFrameBoundRange (const Analyzer::WindowFunction *window_func, CodeGenerator &code_generator, const CompilationOptions &co) |
std::vector< llvm::Value * > | prepareRowModeFuncArgs (bool for_start_bound, SqlWindowFrameBoundType bound_type, const WindowFrameBoundFuncArgs &args) const |
std::vector< llvm::Value * > | prepareRangeModeFuncArgs (bool for_start_bound, const Analyzer::WindowFrame *frame_bound, bool is_timestamp_type_frame, llvm::Value *order_key_null_val, const WindowFrameBoundFuncArgs &frame_args) const |
const std::string | getOrderKeyTypeName (WindowFunctionContext *window_func_context) const |
llvm::Value * | codegenLoadCurrentValueFromColBuf (WindowFunctionContext *window_func_context, CodeGenerator &code_generator, WindowFrameBoundFuncArgs &args) const |
size_t | getOrderKeySize (WindowFunctionContext *window_func_context) const |
const SQLTypeInfo | getFirstOrderColTypeInfo (WindowFunctionContext *window_func_context) const |
std::string | getFramingFuncName (const std::string &bound_type, const std::string &order_col_type, const std::string &op_type, bool for_timestamp_type) const |
void | codegenWindowAvgEpilogue (CodeGenerator *code_generator, const CompilationOptions &co, llvm::Value *crt_val, llvm::Value *window_func_null_val) |
llvm::Value * | codegenAggregateWindowState (CodeGenerator *code_generator, const CompilationOptions &co, llvm::Value *aggregate_state) |
llvm::Value * | aggregateWindowStatePtr (CodeGenerator *code_generator, const CompilationOptions &co) |
CudaMgr_Namespace::CudaMgr * | cudaMgr () const |
bool | isArchPascalOrLater (const ExecutorDeviceType dt) const |
bool | needFetchAllFragments (const InputColDescriptor &col_desc, const RelAlgExecutionUnit &ra_exe_unit, const FragmentsList &selected_fragments) const |
bool | needLinearizeAllFragments (const ColumnDescriptor *cd, const InputColDescriptor &inner_col_desc, const RelAlgExecutionUnit &ra_exe_unit, const FragmentsList &selected_fragments, const Data_Namespace::MemoryLevel memory_level) const |
void | executeWorkUnitPerFragment (const RelAlgExecutionUnit &ra_exe_unit, const InputTableInfo &table_info, const CompilationOptions &co, const ExecutionOptions &eo, const Catalog_Namespace::Catalog &cat, PerFragmentCallBack &cb, const std::set< size_t > &fragment_indexes_param) |
Compiles and dispatches a work unit per fragment processing results with the per fragment callback. Currently used for computing metrics over fragments (metadata). More... | |
ResultSetPtr | executeExplain (const QueryCompilationDescriptor &) |
ResultSetPtr | executeTableFunction (const TableFunctionExecutionUnit exe_unit, const std::vector< InputTableInfo > &table_infos, const CompilationOptions &co, const ExecutionOptions &eo) |
Compiles and dispatches a table function; that is, a function that takes as input one or more columns and returns a ResultSet, which can be parsed by subsequent execution steps. More... | |
ExecutorDeviceType | getDeviceTypeForTargets (const RelAlgExecutionUnit &ra_exe_unit, const ExecutorDeviceType requested_device_type) |
ResultSetPtr | collectAllDeviceResults (SharedKernelContext &shared_context, const RelAlgExecutionUnit &ra_exe_unit, const QueryMemoryDescriptor &query_mem_desc, const ExecutorDeviceType device_type, std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner) |
ResultSetPtr | collectAllDeviceShardedTopResults (SharedKernelContext &shared_context, const RelAlgExecutionUnit &ra_exe_unit, const ExecutorDeviceType device_type) const |
std::unordered_map < shared::TableKey, const Analyzer::BinOper * > | getInnerTabIdToJoinCond () const |
std::vector< std::unique_ptr < ExecutionKernel > > | createKernels (SharedKernelContext &shared_context, const RelAlgExecutionUnit &ra_exe_unit, ColumnFetcher &column_fetcher, const std::vector< InputTableInfo > &table_infos, const ExecutionOptions &eo, const bool is_agg, const bool allow_single_frag_table_opt, const size_t context_count, const QueryCompilationDescriptor &query_comp_desc, const QueryMemoryDescriptor &query_mem_desc, RenderInfo *render_info, std::unordered_set< int > &available_gpus, int &available_cpus) |
void | launchKernelsImpl (SharedKernelContext &shared_context, std::vector< std::unique_ptr< ExecutionKernel >> &&kernels, const ExecutorDeviceType device_type, const size_t requested_num_threads) |
void | launchKernelsLocked (SharedKernelContext &shared_context, std::vector< std::unique_ptr< ExecutionKernel >> &&kernels, const ExecutorDeviceType device_type) |
void | launchKernelsViaResourceMgr (SharedKernelContext &shared_context, std::vector< std::unique_ptr< ExecutionKernel >> &&kernels, const ExecutorDeviceType device_type, const std::vector< InputDescriptor > &input_descs, const QueryMemoryDescriptor &query_mem_desc) |
Launches a vector of kernels for a given query step, gated/scheduled by ExecutorResourceMgr. More... | |
std::vector< size_t > | getTableFragmentIndices (const RelAlgExecutionUnit &ra_exe_unit, const ExecutorDeviceType device_type, const size_t table_idx, const size_t outer_frag_idx, std::map< shared::TableKey, const TableFragments * > &selected_tables_fragments, const std::unordered_map< shared::TableKey, const Analyzer::BinOper * > &inner_table_id_to_join_condition) |
bool | skipFragmentPair (const Fragmenter_Namespace::FragmentInfo &outer_fragment_info, const Fragmenter_Namespace::FragmentInfo &inner_fragment_info, const int inner_table_id, const std::unordered_map< shared::TableKey, const Analyzer::BinOper * > &inner_table_id_to_join_condition, const RelAlgExecutionUnit &ra_exe_unit, const ExecutorDeviceType device_type) |
FetchResult | fetchChunks (const ColumnFetcher &, const RelAlgExecutionUnit &ra_exe_unit, const int device_id, const Data_Namespace::MemoryLevel, const std::map< shared::TableKey, const TableFragments * > &, const FragmentsList &selected_fragments, std::list< ChunkIter > &, std::list< std::shared_ptr< Chunk_NS::Chunk >> &, DeviceAllocator *device_allocator, const size_t thread_idx, const bool allow_runtime_interrupt) |
FetchResult | fetchUnionChunks (const ColumnFetcher &, const RelAlgExecutionUnit &ra_exe_unit, const int device_id, const Data_Namespace::MemoryLevel, const std::map< shared::TableKey, const TableFragments * > &, const FragmentsList &selected_fragments, std::list< ChunkIter > &, std::list< std::shared_ptr< Chunk_NS::Chunk >> &, DeviceAllocator *device_allocator, const size_t thread_idx, const bool allow_runtime_interrupt) |
std::pair< std::vector < std::vector< int64_t > >, std::vector< std::vector < uint64_t > > > | getRowCountAndOffsetForAllFrags (const RelAlgExecutionUnit &ra_exe_unit, const CartesianProduct< std::vector< std::vector< size_t >>> &frag_ids_crossjoin, const std::vector< InputDescriptor > &input_descs, const std::map< shared::TableKey, const TableFragments * > &all_tables_fragments) |
void | buildSelectedFragsMapping (std::vector< std::vector< size_t >> &selected_fragments_crossjoin, std::vector< size_t > &local_col_to_frag_pos, const std::list< std::shared_ptr< const InputColDescriptor >> &col_global_ids, const FragmentsList &selected_fragments, const RelAlgExecutionUnit &ra_exe_unit) |
void | buildSelectedFragsMappingForUnion (std::vector< std::vector< size_t >> &selected_fragments_crossjoin, const FragmentsList &selected_fragments, const RelAlgExecutionUnit &ra_exe_unit) |
std::vector< size_t > | getFragmentCount (const FragmentsList &selected_fragments, const size_t scan_idx, const RelAlgExecutionUnit &ra_exe_unit) |
int32_t | executePlanWithGroupBy (const RelAlgExecutionUnit &ra_exe_unit, const CompilationResult &, const bool hoist_literals, ResultSetPtr *results, const ExecutorDeviceType device_type, std::vector< std::vector< const int8_t * >> &col_buffers, const std::vector< size_t > outer_tab_frag_ids, QueryExecutionContext *, const std::vector< std::vector< int64_t >> &num_rows, const std::vector< std::vector< uint64_t >> &frag_offsets, Data_Namespace::DataMgr *, const int device_id, const shared::TableKey &outer_table_key, const int64_t limit, const uint32_t start_rowid, const uint32_t num_tables, const bool allow_runtime_interrupt, RenderInfo *render_info, const bool optimize_cuda_block_and_grid_sizes, const int64_t rows_to_process=-1) |
int32_t | executePlanWithoutGroupBy (const RelAlgExecutionUnit &ra_exe_unit, const CompilationResult &, const bool hoist_literals, ResultSetPtr *results, const std::vector< Analyzer::Expr * > &target_exprs, const ExecutorDeviceType device_type, std::vector< std::vector< const int8_t * >> &col_buffers, QueryExecutionContext *query_exe_context, const std::vector< std::vector< int64_t >> &num_rows, const std::vector< std::vector< uint64_t >> &frag_offsets, Data_Namespace::DataMgr *data_mgr, const int device_id, const uint32_t start_rowid, const uint32_t num_tables, const bool allow_runtime_interrupt, RenderInfo *render_info, const bool optimize_cuda_block_and_grid_sizes, const int64_t rows_to_process=-1) |
ResultSetPtr | resultsUnion (SharedKernelContext &shared_context, const RelAlgExecutionUnit &ra_exe_unit) |
std::vector< int8_t * > | getJoinHashTablePtrs (const ExecutorDeviceType device_type, const int device_id) |
ResultSetPtr | reduceMultiDeviceResults (const RelAlgExecutionUnit &, std::vector< std::pair< ResultSetPtr, std::vector< size_t >>> &all_fragment_results, std::shared_ptr< RowSetMemoryOwner >, const QueryMemoryDescriptor &) const |
std::vector< std::pair < ResultSetPtr, std::vector < size_t > > > | getUniqueThreadSharedResultSets (const std::vector< std::pair< ResultSetPtr, std::vector< size_t >>> &results_per_device) const |
ResultSetPtr | reduceMultiDeviceResultSets (std::vector< std::pair< ResultSetPtr, std::vector< size_t >>> &all_fragment_results, std::shared_ptr< RowSetMemoryOwner >, const QueryMemoryDescriptor &) const |
ResultSetPtr | reduceSpeculativeTopN (const RelAlgExecutionUnit &, std::vector< std::pair< ResultSetPtr, std::vector< size_t >>> &all_fragment_results, std::shared_ptr< RowSetMemoryOwner >, const QueryMemoryDescriptor &) const |
ResultSetPtr | executeWorkUnitImpl (size_t &max_groups_buffer_entry_guess, const bool is_agg, const bool allow_single_frag_table_opt, const std::vector< InputTableInfo > &, const RelAlgExecutionUnit &, const CompilationOptions &, const ExecutionOptions &options, std::shared_ptr< RowSetMemoryOwner >, RenderInfo *render_info, const bool has_cardinality_estimation, ColumnCacheMap &column_cache) |
std::vector< llvm::Value * > | inlineHoistedLiterals () |
void | AutoTrackBuffersInRuntimeIR () |
std::tuple< CompilationResult, std::unique_ptr < QueryMemoryDescriptor > > | compileWorkUnit (const std::vector< InputTableInfo > &query_infos, const PlanState::DeletedColumnsMap &deleted_cols_map, const RelAlgExecutionUnit &ra_exe_unit, const CompilationOptions &co, const ExecutionOptions &eo, const CudaMgr_Namespace::CudaMgr *cuda_mgr, const bool allow_lazy_fetch, std::shared_ptr< RowSetMemoryOwner >, const size_t max_groups_buffer_entry_count, const int8_t crt_min_byte_width, const bool has_cardinality_estimation, ColumnCacheMap &column_cache, RenderInfo *render_info=nullptr) |
llvm::BasicBlock * | codegenSkipDeletedOuterTableRow (const RelAlgExecutionUnit &ra_exe_unit, const CompilationOptions &co) |
std::vector< JoinLoop > | buildJoinLoops (RelAlgExecutionUnit &ra_exe_unit, const CompilationOptions &co, const ExecutionOptions &eo, const std::vector< InputTableInfo > &query_infos, ColumnCacheMap &column_cache) |
JoinLoop::HoistedFiltersCallback | buildHoistLeftHandSideFiltersCb (const RelAlgExecutionUnit &ra_exe_unit, const size_t level_idx, const shared::TableKey &inner_table_key, const CompilationOptions &co) |
std::function< llvm::Value *(const std::vector < llvm::Value * > &, llvm::Value *)> | buildIsDeletedCb (const RelAlgExecutionUnit &ra_exe_unit, const size_t level_idx, const CompilationOptions &co) |
std::shared_ptr< HashJoin > | buildCurrentLevelHashTable (const JoinCondition ¤t_level_join_conditions, size_t level_idx, RelAlgExecutionUnit &ra_exe_unit, const CompilationOptions &co, const std::vector< InputTableInfo > &query_infos, ColumnCacheMap &column_cache, std::vector< std::string > &fail_reasons) |
void | redeclareFilterFunction () |
llvm::Value * | addJoinLoopIterator (const std::vector< llvm::Value * > &prev_iters, const size_t level_idx) |
void | codegenJoinLoops (const std::vector< JoinLoop > &join_loops, const RelAlgExecutionUnit &ra_exe_unit, GroupByAndAggregate &group_by_and_aggregate, llvm::Function *query_func, llvm::BasicBlock *entry_bb, QueryMemoryDescriptor &query_mem_desc, const CompilationOptions &co, const ExecutionOptions &eo) |
bool | compileBody (const RelAlgExecutionUnit &ra_exe_unit, GroupByAndAggregate &group_by_and_aggregate, QueryMemoryDescriptor &query_mem_desc, const CompilationOptions &co, const GpuSharedMemoryContext &gpu_smem_context={}) |
void | createErrorCheckControlFlow (llvm::Function *query_func, bool run_with_dynamic_watchdog, bool run_with_allowing_runtime_interrupt, const std::vector< JoinLoop > &join_loops, ExecutorDeviceType device_type, const std::vector< InputTableInfo > &input_table_infos) |
void | insertErrorCodeChecker (llvm::Function *query_func, unsigned const error_code_idx, bool hoist_literals, bool allow_runtime_query_interrupt) |
void | preloadFragOffsets (const std::vector< InputDescriptor > &input_descs, const std::vector< InputTableInfo > &query_infos) |
JoinHashTableOrError | buildHashTableForQualifier (const std::shared_ptr< Analyzer::BinOper > &qual_bin_oper, const std::vector< InputTableInfo > &query_infos, const MemoryLevel memory_level, const JoinType join_type, const HashType preferred_hash_type, ColumnCacheMap &column_cache, const HashTableBuildDagMap &hashtable_build_dag_map, const RegisteredQueryHint &query_hint, const TableIdToNodeMap &table_id_to_node_map) |
void | nukeOldState (const bool allow_lazy_fetch, const std::vector< InputTableInfo > &query_infos, const PlanState::DeletedColumnsMap &deleted_cols_map, const RelAlgExecutionUnit *ra_exe_unit) |
std::shared_ptr < CompilationContext > | optimizeAndCodegenCPU (llvm::Function *, llvm::Function *, const std::unordered_set< llvm::Function * > &, const CompilationOptions &) |
std::shared_ptr < CompilationContext > | optimizeAndCodegenGPU (llvm::Function *, llvm::Function *, std::unordered_set< llvm::Function * > &, const bool no_inline, const CudaMgr_Namespace::CudaMgr *cuda_mgr, const bool is_gpu_smem_used, const CompilationOptions &) |
std::string | generatePTX (const std::string &) const |
void | initializeNVPTXBackend () const |
int64_t | deviceCycles (int milliseconds) const |
GroupColLLVMValue | groupByColumnCodegen (Analyzer::Expr *group_by_col, const size_t col_width, const CompilationOptions &, const bool translate_null_val, const int64_t translated_null_val, DiamondCodegen &, std::stack< llvm::BasicBlock * > &, const bool thread_mem_shared) |
llvm::Value * | castToFP (llvm::Value *, SQLTypeInfo const &from_ti, SQLTypeInfo const &to_ti) |
llvm::Value * | castToIntPtrTyIn (llvm::Value *val, const size_t bit_width) |
std::tuple < RelAlgExecutionUnit, PlanState::DeletedColumnsMap > | addDeletedColumn (const RelAlgExecutionUnit &ra_exe_unit, const CompilationOptions &co) |
bool | isFragmentFullyDeleted (const InputDescriptor &table_desc, const Fragmenter_Namespace::FragmentInfo &fragment) |
FragmentSkipStatus | canSkipFragmentForFpQual (const Analyzer::BinOper *comp_expr, const Analyzer::ColumnVar *lhs_col, const Fragmenter_Namespace::FragmentInfo &fragment, const Analyzer::Constant *rhs_const) const |
std::pair< bool, int64_t > | skipFragment (const InputDescriptor &table_desc, const Fragmenter_Namespace::FragmentInfo &frag_info, const std::list< std::shared_ptr< Analyzer::Expr >> &simple_quals, const std::vector< uint64_t > &frag_offsets, const size_t frag_idx) |
std::pair< bool, int64_t > | skipFragmentInnerJoins (const InputDescriptor &table_desc, const RelAlgExecutionUnit &ra_exe_unit, const Fragmenter_Namespace::FragmentInfo &fragment, const std::vector< uint64_t > &frag_offsets, const size_t frag_idx) |
AggregatedColRange | computeColRangesCache (const std::unordered_set< PhysicalInput > &phys_inputs) |
StringDictionaryGenerations | computeStringDictionaryGenerations (const std::unordered_set< PhysicalInput > &phys_inputs) |
TableGenerations | computeTableGenerations (const std::unordered_set< shared::TableKey > &phys_table_keys) |
std::vector< int8_t > | serializeLiterals (const std::unordered_map< int, CgenState::LiteralValues > &literals, const int device_id) |
const std::unique_ptr < llvm::Module > & | get_extension_module (ExtModuleKinds kind) const |
bool | has_extension_module (ExtModuleKinds kind) const |
llvm::Value * | spillDoubleElement (llvm::Value *elem_val, llvm::Type *elem_ty) |
ExecutorMutexHolder | acquireExecuteMutex () |
Static Private Member Functions | |
static size_t | align (const size_t off_in, const size_t alignment) |
Static Private Attributes | |
static const int | max_gpu_count |
static const size_t | auto_num_threads {size_t(0)} |
static std::mutex | gpu_active_modules_mutex_ |
static uint32_t | gpu_active_modules_device_mask_ {0x0} |
static void * | gpu_active_modules_ [max_gpu_count] |
static const size_t | baseline_threshold |
static heavyai::shared_mutex | executor_session_mutex_ |
static InterruptFlagMap | queries_interrupt_flag_ |
static QuerySessionMap | queries_session_map_ |
static std::map< int, std::shared_ptr< Executor > > | executors_ |
static heavyai::shared_mutex | execute_mutex_ |
static heavyai::shared_mutex | executors_cache_mutex_ |
static QueryPlanDagCache | query_plan_dag_cache_ |
static heavyai::shared_mutex | recycler_mutex_ |
static std::unordered_map < CardinalityCacheKey, size_t > | cardinality_cache_ |
static ResultSetRecyclerHolder | resultset_recycler_holder_ |
static QueryPlanDAG | latest_query_plan_extracted_ {EMPTY_QUERY_PLAN} |
Friends | |
class | BaselineJoinHashTable |
class | CodeGenerator |
class | ColumnFetcher |
struct | DiamondCodegen |
class | ExecutionKernel |
class | KernelSubtask |
class | HashJoin |
class | BoundingBoxIntersectJoinHashTable |
class | RangeJoinHashTable |
class | GroupByAndAggregate |
class | QueryCompilationDescriptor |
class | QueryMemoryDescriptor |
class | QueryMemoryInitializer |
class | QueryFragmentDescriptor |
class | QueryExecutionContext |
class | ResultSet |
class | InValuesBitmap |
class | StringDictionaryTranslationMgr |
class | LeafAggregator |
class | PerfectJoinHashTable |
class | QueryRewriter |
class | PendingExecutionClosure |
class | RelAlgExecutor |
class | TableOptimizer |
class | TableFunctionCompilationContext |
class | TableFunctionExecutionContext |
struct | TargetExprCodegenBuilder |
struct | TargetExprCodegen |
class | WindowProjectNodeContext |
using Executor::CachedCardinality = std::pair<bool, size_t> |
using Executor::ExecutorId = size_t |
|
private |
|
strong |
Executor::Executor | ( | const ExecutorId | id, |
Data_Namespace::DataMgr * | data_mgr, | ||
const size_t | block_size_x, | ||
const size_t | grid_size_x, | ||
const size_t | max_gpu_slab_size, | ||
const std::string & | debug_dir, | ||
const std::string & | debug_file | ||
) |
Definition at line 276 of file Execute.cpp.
|
inlineprivate |
Definition at line 1591 of file Execute.h.
References execute_mutex_, executor_id_, Executor::ExecutorMutexHolder::shared_lock, Executor::ExecutorMutexHolder::unique_lock, and UNITARY_EXECUTOR_ID.
|
private |
Definition at line 4475 of file Execute.cpp.
References anonymous_namespace{Execute.cpp}::add_deleted_col_to_map(), CHECK, CompilationOptions::filter_on_deleted_column, Catalog_Namespace::SysCatalog::getCatalog(), Catalog_Namespace::SysCatalog::instance(), and TABLE.
Referenced by executeWorkUnitImpl(), and executeWorkUnitPerFragment().
|
private |
Definition at line 1186 of file IRCodegen.cpp.
References AUTOMATIC_IR_METADATA, and CHECK.
void Executor::addToCardinalityCache | ( | const CardinalityCacheKey & | cache_key, |
const size_t | cache_value | ||
) |
Definition at line 5289 of file Execute.cpp.
References cardinality_cache_, g_use_estimator_result_cache, recycler_mutex_, and VLOG.
bool Executor::addToQuerySessionList | ( | const QuerySessionId & | query_session, |
const std::string & | query_str, | ||
const std::string & | submitted, | ||
const size_t | executor_id, | ||
const QuerySessionStatus::QueryStatus | query_status, | ||
heavyai::unique_lock< heavyai::shared_mutex > & | write_lock | ||
) |
Definition at line 5120 of file Execute.cpp.
References queries_interrupt_flag_, and queries_session_map_.
Referenced by enrollQuerySession().
void Executor::addTransientStringLiterals | ( | const RelAlgExecutionUnit & | ra_exe_unit, |
const std::shared_ptr< RowSetMemoryOwner > & | row_set_mem_owner | ||
) |
Definition at line 2523 of file Execute.cpp.
References CHECK, getStringDictionaryProxy(), RelAlgExecutionUnit::groupby_exprs, kENCODING_DICT, kMODE, kSAMPLE, kSINGLE_VALUE, RelAlgExecutionUnit::quals, RelAlgExecutionUnit::simple_quals, RelAlgExecutionUnit::target_exprs, RelAlgExecutionUnit::target_exprs_union, and ScalarExprVisitor< T >::visit().
|
static |
Definition at line 1956 of file NativeCodegen.cpp.
Referenced by DBHandler::initialize().
|
private |
Definition at line 242 of file WindowFunctionIR.cpp.
References AUTOMATIC_IR_METADATA, CodegenUtil::createPtrWithHoistedMemoryAddr(), anonymous_namespace{WindowFunctionIR.cpp}::get_adjusted_window_type_info(), get_int_type(), WindowProjectNodeContext::getActiveWindowFunctionContext(), kFLOAT, and WindowFunctionContext::NUM_EXECUTION_DEVICES.
|
inlinestaticprivate |
Definition at line 1468 of file Execute.h.
Referenced by serializeLiterals().
CurrentQueryStatus Executor::attachExecutorToQuerySession | ( | const QuerySessionId & | query_session_id, |
const std::string & | query_str, | ||
const std::string & | query_submitted_time | ||
) |
Definition at line 5018 of file Execute.cpp.
References executor_id_, executor_session_mutex_, updateQuerySessionExecutorAssignment(), and updateQuerySessionStatusWithLock().
|
private |
Definition at line 2303 of file NativeCodegen.cpp.
unsigned Executor::blockSize | ( | ) | const |
Definition at line 4366 of file Execute.cpp.
References block_size_x_, CHECK, data_mgr_, CudaMgr_Namespace::CudaMgr::getAllDeviceProperties(), and Data_Namespace::DataMgr::getCudaMgr().
Referenced by collectAllDeviceShardedTopResults(), executePlanWithGroupBy(), executePlanWithoutGroupBy(), executeTableFunction(), executeWorkUnitImpl(), reduceMultiDeviceResults(), reduceMultiDeviceResultSets(), and resultsUnion().
|
private |
Definition at line 1027 of file IRCodegen.cpp.
References anonymous_namespace{IRCodegen.cpp}::add_qualifier_to_execution_unit(), AUTOMATIC_IR_METADATA, anonymous_namespace{IRCodegen.cpp}::check_valid_join_qual(), Data_Namespace::CPU_LEVEL, CompilationOptions::device_type, Executor::JoinHashTableOrError::fail_reason, GPU, Data_Namespace::GPU_LEVEL, Executor::JoinHashTableOrError::hash_table, RelAlgExecutionUnit::hash_table_build_plan_dag, IS_EQUIVALENCE, LEFT, OneToOne, JoinCondition::quals, RelAlgExecutionUnit::query_hint, RelAlgExecutionUnit::table_id_to_node_map, JoinCondition::type, and VLOG.
|
private |
Definition at line 4309 of file Execute.cpp.
References deviceCountForMemoryLevel(), g_enable_bbox_intersect_hashjoin, g_enable_dynamic_watchdog, HashJoin::getInstance(), and interrupted_.
|
private |
Definition at line 859 of file IRCodegen.cpp.
References AUTOMATIC_IR_METADATA, CHECK, CodeGenerator::codegen(), g_enable_left_join_filter_hoisting, RelAlgExecutionUnit::join_quals, LEFT, RelAlgExecutionUnit::quals, RelAlgExecutionUnit::simple_quals, CodeGenerator::toBool(), and VLOG.
|
private |
Definition at line 968 of file IRCodegen.cpp.
References AUTOMATIC_IR_METADATA, CHECK, CHECK_LT, CodeGenerator::codegen(), CompilationOptions::filter_on_deleted_column, RelAlgExecutionUnit::input_descs, TABLE, and CodeGenerator::toBool().
|
private |
Definition at line 610 of file IRCodegen.cpp.
References AUTOMATIC_IR_METADATA, CodeGenerator::cgen_state_, CHECK, CHECK_LT, CodeGenerator::codegen(), INJECT_TIMER, CgenState::ir_builder_, RelAlgExecutionUnit::join_quals, LEFT, PlanState::left_join_non_hashtable_quals_, CgenState::llBool(), MultiSet, OneToOne, CgenState::outer_join_match_found_per_level_, CodeGenerator::plan_state_, Set, Singleton, JoinLoopDomain::slot_lookup_result, CodeGenerator::toBool(), and JoinLoopDomain::values_buffer.
|
private |
Definition at line 3774 of file Execute.cpp.
References CHECK, CHECK_EQ, CHECK_LT, getFragmentCount(), RelAlgExecutionUnit::input_descs, and plan_state_.
Referenced by fetchChunks().
|
private |
Definition at line 3805 of file Execute.cpp.
References RelAlgExecutionUnit::input_descs.
Referenced by fetchUnionChunks().
|
private |
Definition at line 4598 of file Execute.cpp.
References CHECK, shared::ColumnKey::column_id, extract_max_stat_fp_type(), extract_min_stat_fp_type(), Analyzer::Constant::get_constval(), Analyzer::BinOper::get_optype(), SQLTypeInfo::get_type(), Analyzer::Expr::get_type_info(), Fragmenter_Namespace::FragmentInfo::getChunkMetadataMap(), Analyzer::ColumnVar::getColumnKey(), INVALID, kDOUBLE, kEQ, kFLOAT, kGE, kGT, kLE, kLT, NOT_SKIPPABLE, and SKIPPABLE.
Referenced by skipFragment().
|
private |
Definition at line 4401 of file Execute.cpp.
References AUTOMATIC_IR_METADATA, cgen_state_, exp_to_scale(), logger::FATAL, SQLTypeInfo::get_scale(), SQLTypeInfo::get_size(), SQLTypeInfo::is_fp(), SQLTypeInfo::is_number(), and LOG.
|
private |
Definition at line 4428 of file Execute.cpp.
References AUTOMATIC_IR_METADATA, cgen_state_, CHECK, CHECK_LT, and get_int_type().
bool Executor::checkCurrentQuerySession | ( | const std::string & | candidate_query_session, |
heavyai::shared_lock< heavyai::shared_mutex > & | read_lock | ||
) |
bool Executor::checkIsQuerySessionEnrolled | ( | const QuerySessionId & | query_session, |
heavyai::shared_lock< heavyai::shared_mutex > & | read_lock | ||
) |
Definition at line 5265 of file Execute.cpp.
References queries_session_map_.
Referenced by executeWorkUnitImpl().
bool Executor::checkIsQuerySessionInterrupted | ( | const std::string & | query_session, |
heavyai::shared_lock< heavyai::shared_mutex > & | read_lock | ||
) |
Definition at line 5254 of file Execute.cpp.
References queries_interrupt_flag_.
Referenced by executePlanWithGroupBy(), executePlanWithoutGroupBy(), fetchChunks(), and fetchUnionChunks().
bool Executor::checkNonKernelTimeInterrupted | ( | ) | const |
Definition at line 5363 of file Execute.cpp.
References current_query_session_, executor_id_, executor_session_mutex_, queries_interrupt_flag_, and UNITARY_EXECUTOR_ID.
void Executor::checkPendingQueryStatus | ( | const QuerySessionId & | query_session | ) |
Definition at line 5035 of file Execute.cpp.
References executor_session_mutex_, queries_interrupt_flag_, queries_session_map_, and VLOG.
void Executor::clearCaches | ( | bool | runtime_only = false | ) |
|
static |
Definition at line 5309 of file Execute.cpp.
References cardinality_cache_, g_use_estimator_result_cache, and recycler_mutex_.
Referenced by clearExternalCaches().
|
inlinestatic |
Definition at line 438 of file Execute.h.
References clearCardinalityCache(), TableDescriptor::getTableChunkKey(), hash_value(), CacheInvalidator< CACHE_HOLDING_TYPES >::invalidateCaches(), CacheInvalidator< CACHE_HOLDING_TYPES >::invalidateCachesByTable(), invalidateCardinalityCacheForTable(), and TableDescriptor::tableId.
Referenced by AlterTableAlterColumnCommand::clearInMemoryData(), clearMemory(), DropForeignTableCommand::execute(), Parser::InsertIntoTableAsSelectStmt::execute(), Parser::DropTableStmt::execute(), Parser::TruncateTableStmt::execute(), Parser::OptimizeTableStmt::execute(), Parser::AddColumnStmt::execute(), Parser::DropColumnStmt::execute(), Parser::AlterTableParamStmt::execute(), Parser::CopyTableStmt::execute(), RelAlgExecutor::executeDelete(), RelAlgExecutor::executeSimpleInsert(), RelAlgExecutor::executeUpdate(), Catalog_Namespace::Catalog::invalidateCachesForTable(), foreign_storage::refresh_foreign_table_unlocked(), DBHandler::set_table_epochs(), Catalog_Namespace::Catalog::setUncappedTableEpoch(), and DBHandler::shutdown().
|
static |
Definition at line 535 of file Execute.cpp.
References clearExternalCaches(), Data_Namespace::DataMgr::clearMemory(), Data_Namespace::CPU_LEVEL, execute_mutex_, Catalog_Namespace::SysCatalog::getDataMgr(), Data_Namespace::GPU_LEVEL, Catalog_Namespace::SysCatalog::instance(), and CacheInvalidator< CACHE_HOLDING_TYPES >::invalidateCaches().
Referenced by DBHandler::clear_cpu_memory(), DBHandler::clear_gpu_memory(), QueryRunner::QueryRunner::clearCpuMemory(), and QueryRunner::QueryRunner::clearGpuMemory().
|
private |
Definition at line 1054 of file Execute.cpp.
References agg_col_range_cache_, TableGenerations::clear(), AggregatedColRange::clear(), InputTableInfoCache::clear(), input_table_info_cache_, and table_generations_.
void Executor::clearQuerySessionStatus | ( | const QuerySessionId & | query_session, |
const std::string & | submitted_time_str | ||
) |
Definition at line 5061 of file Execute.cpp.
References current_query_session_, executor_session_mutex_, invalidateRunningQuerySession(), removeFromQuerySessionList(), and resetInterrupt().
|
private |
Definition at line 1510 of file WindowFunctionIR.cpp.
References AUTOMATIC_IR_METADATA, AVG, COUNT, CodegenUtil::createPtrWithHoistedMemoryAddr(), anonymous_namespace{WindowFunctionIR.cpp}::get_adjusted_window_type_info(), get_int_type(), WindowProjectNodeContext::getActiveWindowFunctionContext(), Analyzer::WindowFunction::getKind(), kDECIMAL, kDOUBLE, kFLOAT, and WindowFunctionContext::NUM_EXECUTION_DEVICES.
|
private |
Definition at line 1577 of file WindowFunctionIR.cpp.
References CHECK, and kSUM_IF.
|
private |
Definition at line 781 of file WindowFunctionIR.cpp.
References CodegenUtil::createPtrWithHoistedMemoryAddr(), WindowFunctionContext::elementCount(), get_int_type(), WindowFunctionContext::getWindowFunction(), Analyzer::WindowFunction::isFrameNavigateWindowFunction(), WindowFunctionContext::NUM_EXECUTION_DEVICES, WindowFunctionContext::partitionCount(), WindowFunctionContext::partitionNumCountBuf(), and WindowFunctionContext::payload().
|
private |
Definition at line 649 of file WindowFunctionIR.cpp.
References CHECK, CURRENT_ROW, WindowFrameBoundFuncArgs::current_row_pos_lv, EXPR_FOLLOWING, EXPR_PRECEDING, WindowFrameBoundFuncArgs::frame_end_bound_expr_lv, WindowFrameBoundFuncArgs::frame_start_bound_expr_lv, Analyzer::WindowFrame::getBoundType(), WindowFrameBoundFuncArgs::int64_t_one_val_lv, WindowFrameBoundFuncArgs::int64_t_zero_val_lv, WindowFrameBoundFuncArgs::num_elem_current_partition_lv, WindowFrameBoundFuncArgs::order_type_col_name, UNBOUNDED_FOLLOWING, and UNBOUNDED_PRECEDING.
|
private |
Definition at line 598 of file WindowFunctionIR.cpp.
References CHECK, CodeGenerator::codegen(), EXPR_FOLLOWING, EXPR_PRECEDING, g_cluster, SQLTypeInfo::get_size(), Analyzer::Expr::get_type_info(), Analyzer::WindowFrame::getBoundExpr(), Analyzer::WindowFunction::getOrderKeys(), Analyzer::WindowFunction::hasRangeModeFraming(), kBIGINT, kINT, and kSMALLINT.
|
private |
Definition at line 1065 of file WindowFunctionIR.cpp.
References CHECK, Analyzer::WindowFunction::getFrameEndBound(), and Analyzer::WindowFunction::getFrameStartBound().
|
private |
Definition at line 904 of file WindowFunctionIR.cpp.
References CodegenUtil::createPtrWithHoistedMemoryAddr(), get_int_type(), WindowFunctionContext::getNullValueEndPos(), WindowFunctionContext::getNullValueStartPos(), and WindowFunctionContext::NUM_EXECUTION_DEVICES.
|
private |
Definition at line 1204 of file IRCodegen.cpp.
References ExecutionOptions::allow_runtime_query_interrupt, anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of(), AUTOMATIC_IR_METADATA, CHECK, CHECK_EQ, JoinLoop::codegen(), CompilationOptions::device_type, JoinLoopDomain::element_count, get_int_array_type(), get_int_type(), INNER, MultiSet, CodeGenerator::posArg(), GroupByAndAggregate::query_infos_, query_mem_desc, Set, and ExecutionOptions::with_dynamic_watchdog.
|
private |
Definition at line 753 of file WindowFunctionIR.cpp.
References CHECK, CodeGenerator::codegenWindowPosition(), WindowFrameBoundFuncArgs::current_row_pos_lv, get_fp_type(), get_int_type(), Analyzer::WindowFunction::getOrderKeys(), WindowFunctionContext::getWindowFunction(), Analyzer::WindowFunction::isFrameNavigateWindowFunction(), and WindowFrameBoundFuncArgs::order_key_buf_ptr_lv.
|
private |
Definition at line 948 of file WindowFunctionIR.cpp.
References CodegenUtil::createPtrWithHoistedMemoryAddr(), anonymous_namespace{WindowFunctionIR.cpp}::get_col_type_name_by_size(), get_fp_type(), get_int_type(), WindowFunctionContext::getOrderKeyColumnBuffers(), WindowFunctionContext::getOrderKeyColumnBufferTypes(), Analyzer::WindowFunction::getOrderKeys(), WindowFunctionContext::getWindowFunction(), and WindowFunctionContext::NUM_EXECUTION_DEVICES.
|
private |
Definition at line 976 of file WindowFunctionIR.cpp.
References WindowFunctionContext::counts(), CodegenUtil::createPtrWithHoistedMemoryAddr(), WindowPartitionBufferPtrs::current_partition_start_offset_lv, get_int_type(), WindowPartitionBufferPtrs::num_elem_current_partition_lv, WindowFunctionContext::NUM_EXECUTION_DEVICES, WindowFunctionContext::partitionStartOffset(), WindowFunctionContext::payload(), WindowFunctionContext::sortedPartition(), WindowPartitionBufferPtrs::target_partition_rowid_ptr_lv, and WindowPartitionBufferPtrs::target_partition_sorted_rowid_ptr_lv.
|
private |
Definition at line 3311 of file NativeCodegen.cpp.
|
private |
Definition at line 1466 of file WindowFunctionIR.cpp.
References AUTOMATIC_IR_METADATA, CodegenUtil::createPtrWithHoistedMemoryAddr(), anonymous_namespace{WindowFunctionIR.cpp}::get_adjusted_window_type_info(), get_int_type(), WindowProjectNodeContext::getActiveWindowFunctionContext(), kDOUBLE, kFLOAT, and WindowFunctionContext::NUM_EXECUTION_DEVICES.
|
private |
Definition at line 1080 of file WindowFunctionIR.cpp.
References run_benchmark_import::args, CHECK, WindowFrameBoundFuncArgs::current_col_value_lv, WindowFunctionContext::getOrderKeyColumnBuffers(), WindowFunctionContext::getWindowFunction(), Analyzer::WindowFrame::hasTimestampTypeFrameBound(), and WindowFrameBoundFuncArgs::order_type_col_name.
|
private |
Definition at line 22 of file WindowFunctionIR.cpp.
References WindowProjectNodeContext::activateWindowFunctionContext(), run_benchmark_import::args, AUTOMATIC_IR_METADATA, AVG, BACKWARD_FILL, CHECK, CHECK_EQ, CONDITIONAL_CHANGE_EVENT, COUNT, COUNT_IF, CUME_DIST, DENSE_RANK, logger::FATAL, FIRST_VALUE, FIRST_VALUE_IN_FRAME, FORWARD_FILL, WindowProjectNodeContext::get(), WindowFunctionContext::getWindowFunction(), LAG, LAG_IN_FRAME, LAST_VALUE, LAST_VALUE_IN_FRAME, LEAD, LEAD_IN_FRAME, LOG, MAX, MIN, NTH_VALUE, NTH_VALUE_IN_FRAME, NTILE, PERCENT_RANK, RANK, ROW_NUMBER, SUM, and SUM_IF.
|
private |
Definition at line 265 of file WindowFunctionIR.cpp.
References AUTOMATIC_IR_METADATA, AVG, CHECK, CodegenUtil::createPtrWithHoistedMemoryAddr(), WindowProjectNodeContext::get(), get_int_type(), WindowProjectNodeContext::getActiveWindowFunctionContext(), and WindowFunctionContext::NUM_EXECUTION_DEVICES.
|
private |
Definition at line 1129 of file WindowFunctionIR.cpp.
References run_benchmark_import::args, AUTOMATIC_IR_METADATA, AVG, CHECK, CHECK_EQ, CodeGenerator::codegen(), CodeGenerator::codegenCastBetweenIntTypes(), COUNT, COUNT_IF, CodegenUtil::createPtrWithHoistedMemoryAddr(), WindowFrameBoundFuncArgs::current_partition_start_offset_lv, anonymous_namespace{WindowFunctionIR.cpp}::get_adjusted_window_type_info(), anonymous_namespace{WindowFunctionIR.cpp}::get_col_type_name_by_size(), get_int_type(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), anonymous_namespace{WindowFunctionIR.cpp}::get_window_agg_name(), WindowProjectNodeContext::getActiveWindowFunctionContext(), inline_fixed_encoding_null_val(), kDATE, kDOUBLE, kENCODING_DATE_IN_DAYS, kENCODING_FIXED, kFLOAT, kSUM_IF, kTIME, kTIMESTAMP, kTINYINT, MAX, MIN, WindowFunctionContext::NUM_EXECUTION_DEVICES, CodeGenerator::posArg(), SUM, SUM_IF, and window_function_conditional_aggregate().
|
private |
Definition at line 339 of file WindowFunctionIR.cpp.
References AUTOMATIC_IR_METADATA, COUNT, COUNT_IF, anonymous_namespace{WindowFunctionIR.cpp}::get_adjusted_window_type_info(), get_int_type(), WindowProjectNodeContext::getActiveWindowFunctionContext(), kDOUBLE, and kFLOAT.
|
private |
Definition at line 392 of file WindowFunctionIR.cpp.
References run_benchmark_import::args, AUTOMATIC_IR_METADATA, CHECK, CodegenUtil::createPtrWithHoistedMemoryAddr(), WindowFrameBoundFuncArgs::current_partition_start_offset_lv, FIRST_VALUE_IN_FRAME, FORWARD_FILL, anonymous_namespace{WindowFunctionIR.cpp}::get_col_type_name_by_size(), get_fp_type(), get_int_type(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size(), anonymous_namespace{WindowFunctionIR.cpp}::get_null_value_by_size_with_encoding(), WindowProjectNodeContext::getActiveWindowFunctionContext(), kENCODING_DATE_IN_DAYS, kSecsPerDay, LAG_IN_FRAME, LAST_VALUE_IN_FRAME, LEAD_IN_FRAME, NTH_VALUE_IN_FRAME, WindowFunctionContext::NUM_EXECUTION_DEVICES, and UNREACHABLE.
|
private |
Definition at line 299 of file WindowFunctionIR.cpp.
References AUTOMATIC_IR_METADATA, CodegenUtil::createPtrWithHoistedMemoryAddr(), get_int_type(), WindowProjectNodeContext::getActiveWindowFunctionContext(), WindowFunctionContext::NUM_EXECUTION_DEVICES, CodeGenerator::posArg(), and CodeGenerator::toBool().
|
private |
Definition at line 2715 of file Execute.cpp.
References anonymous_namespace{Execute.cpp}::build_row_for_empty_input(), collectAllDeviceShardedTopResults(), DEBUG_TIMER, SharedKernelContext::getFragmentResults(), QueryMemoryDescriptor::getQueryDescriptionType(), GPU, heavyai::NonGroupedAggregate, reduceMultiDeviceResults(), reduceSpeculativeTopN(), GroupByAndAggregate::shard_count_for_top_groups(), RelAlgExecutionUnit::target_exprs, and use_speculative_top_n().
Referenced by executeWorkUnitImpl().
|
private |
Definition at line 2830 of file Execute.cpp.
References blockSize(), CHECK, CHECK_EQ, CHECK_LE, SharedKernelContext::getFragmentResults(), gridSize(), SortInfo::limit, SortInfo::offset, SortInfo::order_entries, anonymous_namespace{Execute.cpp}::permute_storage_columnar(), anonymous_namespace{Execute.cpp}::permute_storage_row_wise(), run_benchmark_import::result, and RelAlgExecutionUnit::sort_info.
Referenced by collectAllDeviceResults().
|
private |
Definition at line 3347 of file NativeCodegen.cpp.
|
private |
Definition at line 2816 of file NativeCodegen.cpp.
|
private |
Definition at line 4894 of file Execute.cpp.
References CHECK, Catalog_Namespace::get_metadata_for_column(), getLeafColumnRange(), getTableInfo(), AggregatedColRange::setColRange(), and ExpressionRange::typeSupportsRange().
Referenced by setupCaching().
|
private |
Definition at line 4922 of file Execute.cpp.
References CHECK, Catalog_Namespace::SysCatalog::getCatalog(), Catalog_Namespace::SysCatalog::instance(), kENCODING_DICT, anonymous_namespace{Execute.cpp}::prepare_string_dictionaries(), and StringDictionaryGenerations::setGeneration().
Referenced by setupCaching().
|
private |
Definition at line 4948 of file Execute.cpp.
References getTableInfo(), and TableGenerations::setGeneration().
Referenced by setupCaching().
|
inline |
|
private |
Definition at line 2029 of file NativeCodegen.cpp.
|
private |
Determines execution dispatch mode and required fragments for a given query step, then creates kernels to execute the query and returns them for launch.
Definition at line 2907 of file Execute.cpp.
References ExecutionOptions::allow_multifrag, CHECK, CHECK_GE, CHECK_GT, anonymous_namespace{Execute.cpp}::checkWorkUnitWatchdog(), data_mgr_, deviceCount(), g_inner_join_fragment_skipping, getColLazyFetchInfo(), QueryCompilationDescriptor::getDeviceType(), QueryMemoryDescriptor::getEntryCount(), SharedKernelContext::getFragOffsets(), Data_Namespace::DataMgr::getMemoryInfo(), QueryMemoryDescriptor::getQueryDescriptionType(), GPU, ExecutionOptions::gpu_input_mem_limit_percent, Data_Namespace::GPU_LEVEL, anonymous_namespace{Execute.cpp}::has_lazy_fetched_columns(), logger::INFO, RelAlgExecutionUnit::input_descs, KernelPerFragment, LOG, MultifragmentKernel, ExecutionOptions::outer_fragment_indices, plan_state_, heavyai::Projection, query_mem_desc, RelAlgExecutionUnit::target_exprs, QueryMemoryDescriptor::toString(), RelAlgExecutionUnit::use_bump_allocator, VLOG, and ExecutionOptions::with_watchdog.
Referenced by executeWorkUnitImpl().
|
inlineprivate |
Definition at line 865 of file Execute.h.
References CHECK, data_mgr_, and Data_Namespace::DataMgr::getCudaMgr().
Referenced by deviceCount(), deviceCycles(), isArchPascalOrLater(), numBlocksPerMP(), and warpSize().
int Executor::deviceCount | ( | const ExecutorDeviceType | device_type | ) | const |
Definition at line 1322 of file Execute.cpp.
References cudaMgr(), CudaMgr_Namespace::CudaMgr::getDeviceCount(), and GPU.
Referenced by createKernels(), and deviceCountForMemoryLevel().
|
private |
Definition at line 1330 of file Execute.cpp.
References CPU, deviceCount(), GPU, and Data_Namespace::GPU_LEVEL.
Referenced by buildHashTableForQualifier().
|
private |
Definition at line 4396 of file Execute.cpp.
References cudaMgr(), and CudaMgr_Namespace::CudaMgr::getAllDeviceProperties().
std::string Executor::dumpCache | ( | ) | const |
Definition at line 5520 of file Execute.cpp.
References agg_col_range_cache_, TableGenerations::asMap(), AggregatedColRange::asMap(), row_set_mem_owner_, and table_generations_.
void Executor::enableRuntimeQueryInterrupt | ( | const double | runtime_query_check_freq, |
const unsigned | pending_query_check_freq | ||
) | const |
Definition at line 5274 of file Execute.cpp.
References g_enable_runtime_query_interrupt, g_pending_query_interrupt_freq, and g_running_query_interrupt_freq.
void Executor::enrollQuerySession | ( | const QuerySessionId & | query_session, |
const std::string & | query_str, | ||
const std::string & | submitted_time_str, | ||
const size_t | executor_id, | ||
const QuerySessionStatus::QueryStatus | query_session_status | ||
) |
Definition at line 5091 of file Execute.cpp.
References addToQuerySessionList(), current_query_session_, and executor_session_mutex_.
|
private |
Definition at line 2519 of file Execute.cpp.
References QueryCompilationDescriptor::getIR().
Referenced by executeWorkUnitImpl().
|
private |
Definition at line 4061 of file Execute.cpp.
References anonymous_namespace{Utm.h}::a, blockSize(), CHECK, CHECK_NE, anonymous_namespace{Execute.cpp}::check_rows_less_than_needed(), checkIsQuerySessionInterrupted(), CPU, DEBUG_TIMER, report::error_code(), executor_session_mutex_, logger::FATAL, g_enable_dynamic_watchdog, CompilationResult::generated_code, getCurrentQuerySession(), QueryMemoryDescriptor::getEntryCount(), getJoinHashTablePtrs(), QueryExecutionContext::getRowSet(), GpuSharedMemoryContext::getSharedMemorySize(), CompilationResult::gpu_smem_context, gridSize(), RelAlgExecutionUnit::groupby_exprs, INJECT_TIMER, RelAlgExecutionUnit::input_col_descs, RelAlgExecutionUnit::input_descs, interrupted_, QueryExecutionContext::launchCpuCode(), QueryExecutionContext::launchGpuCode(), CompilationResult::literal_values, LOG, shared::printContainer(), QueryExecutionContext::query_buffers_, QueryExecutionContext::query_mem_desc_, RenderInfo::render_allocator_map_ptr, RelAlgExecutionUnit::scan_limit, serializeLiterals(), QueryMemoryDescriptor::setEntryCount(), RelAlgExecutionUnit::union_all, RenderInfo::useCudaBuffers(), and VLOG.
|
private |
Definition at line 3834 of file Execute.cpp.
References blockSize(), CHECK, CHECK_EQ, checkIsQuerySessionInterrupted(), CPU, DEBUG_TIMER, report::error_code(), RelAlgExecutionUnit::estimator, QueryExecutionContext::estimator_result_set_, executor_session_mutex_, logger::FATAL, g_bigint_count, g_enable_dynamic_watchdog, CompilationResult::generated_code, get_target_info(), QueryExecutionContext::getAggInitValForIndex(), getCurrentQuerySession(), getJoinHashTablePtrs(), QueryMemoryDescriptor::getPaddedSlotWidthBytes(), GpuSharedMemoryContext::getSharedMemorySize(), GPU, CompilationResult::gpu_smem_context, gridSize(), INJECT_TIMER, interrupted_, is_distinct_target(), heavyai::InSituFlagsOwnerInterface::isInSitu(), GpuSharedMemoryContext::isSharedMemoryUsed(), kAVG, kCOUNT, kSAMPLE, QueryExecutionContext::launchCpuCode(), QueryExecutionContext::launchGpuCode(), CompilationResult::literal_values, LOG, QueryExecutionContext::query_buffers_, QueryExecutionContext::query_mem_desc_, reduceResults(), RenderInfo::render_allocator_map_ptr, serializeLiterals(), takes_float_argument(), and RenderInfo::useCudaBuffers().
|
private |
Compiles and dispatches a table function; that is, a function that takes as input one or more columns and returns a ResultSet, which can be parsed by subsequent execution steps.
Definition at line 2445 of file Execute.cpp.
References blockSize(), TableFunctionCompilationContext::compile(), table_functions::TableFunction::containsPreFlightFn(), CPU, CompilationOptions::device_type, TableFunctionExecutionContext::execute(), ResultSet::fixupQueryMemoryDescriptor(), getRowSetMemoryOwner(), GPU, gridSize(), table_functions::TableFunction::hasTableFunctionSpecifiedParameter(), INJECT_TIMER, ExecutionOptions::just_validate, CompilationOptions::makeCpuOnly(), query_mem_desc, TableFunctionExecutionUnit::table_func, heavyai::TableFunction, TableFunctionExecutionUnit::target_exprs, and target_exprs_to_infos().
TableUpdateMetadata Executor::executeUpdate | ( | const RelAlgExecutionUnit & | ra_exe_unit, |
const std::vector< InputTableInfo > & | table_infos, | ||
const TableDescriptor * | updated_table_desc, | ||
const CompilationOptions & | co, | ||
const ExecutionOptions & | eo, | ||
const Catalog_Namespace::Catalog & | cat, | ||
std::shared_ptr< RowSetMemoryOwner > | row_set_mem_owner, | ||
const UpdateLogForFragment::Callback & | cb, | ||
const bool | is_agg | ||
) |
Definition at line 65 of file ExecuteUpdate.cpp.
References anonymous_namespace{Utm.h}::a, CHECK, CHECK_EQ, CHECK_GT, CPU, FragmentsPerTable::fragment_ids, g_enable_auto_metadata_update, SharedKernelContext::getFragmentResults(), SharedKernelContext::getFragOffsets(), Catalog_Namespace::Catalog::getMetadataForTable(), KernelPerFragment, query_mem_desc, ExecutionKernel::run(), TableDescriptor::tableId, timer_start(), timer_stop(), and VLOG.
ResultSetPtr Executor::executeWorkUnit | ( | size_t & | max_groups_buffer_entry_guess, |
const bool | is_agg, | ||
const std::vector< InputTableInfo > & | query_infos, | ||
const RelAlgExecutionUnit & | ra_exe_unit_in, | ||
const CompilationOptions & | co, | ||
const ExecutionOptions & | options, | ||
RenderInfo * | render_info, | ||
const bool | has_cardinality_estimation, | ||
ColumnCacheMap & | column_cache | ||
) |
Definition at line 2099 of file Execute.cpp.
References cgen_state_, compilation_queue_time_ms_, executeWorkUnitImpl(), executor_id_, ExecutionOptions::just_validate, kernel_queue_time_ms_, CompilationRetryNewScanLimit::new_scan_limit_, plan_state_, anonymous_namespace{Execute.cpp}::replace_scan_limit(), run_benchmark_import::result, row_set_mem_owner_, and VLOG.
|
private |
Definition at line 2166 of file Execute.cpp.
References addDeletedColumn(), ExecutionOptions::allow_runtime_query_interrupt, blockSize(), CHECK, CHECK_EQ, checkIsQuerySessionEnrolled(), collectAllDeviceResults(), anonymous_namespace{Execute.cpp}::compute_buffer_entry_guess(), CPU, cpu_threads(), createKernels(), data_mgr_, CompilationOptions::device_type, ExecutionOptions::estimate_output_cardinality, executeExplain(), executor_session_mutex_, ExecutionOptions::executor_type, ColumnFetcher::freeLinearizedBuf(), ColumnFetcher::freeTemporaryCpuLinearizedIdxBuf(), g_enable_executor_resource_mgr, get_available_gpus(), get_context_count(), getCurrentQuerySession(), getDeviceTypeForTargets(), QueryExecutionError::getErrorCode(), SharedKernelContext::getFragmentResults(), gridSize(), QueryExecutionError::hasErrorCode(), INJECT_TIMER, interrupted_, ExecutionOptions::just_explain, ExecutionOptions::just_validate, launchKernelsLocked(), launchKernelsViaResourceMgr(), MAX_BYTE_WIDTH_SUPPORTED, Native, RelAlgExecutionUnit::per_device_cardinality, plan_state_, heavyai::Projection, QueryMemoryDescriptor, run_benchmark_import::result, resultsUnion(), row_set_mem_owner_, QuerySessionStatus::RUNNING_REDUCTION, toString(), updateQuerySessionStatus(), VLOG, and ExecutionOptions::with_dynamic_watchdog.
Referenced by executeWorkUnit().
|
private |
Compiles and dispatches a work unit per fragment processing results with the per fragment callback. Currently used for computing metrics over fragments (metadata).
Definition at line 2365 of file Execute.cpp.
References addDeletedColumn(), CHECK, CHECK_EQ, CompilationOptions::device_type, Fragmenter_Namespace::TableInfo::fragments, SharedKernelContext::getFragmentResults(), InputTableInfo::info, kernel_mutex_, kernel_queue_time_ms_, KernelPerFragment, ExecutionKernel::run(), timer_start(), and timer_stop().
|
private |
Definition at line 3458 of file Execute.cpp.
References buildSelectedFragsMapping(), CHECK, CHECK_EQ, CHECK_LT, checkIsQuerySessionInterrupted(), Data_Namespace::CPU_LEVEL, DEBUG_TIMER, executor_session_mutex_, g_enable_dynamic_watchdog, ColumnFetcher::getAllTableColumnFragments(), getCurrentQuerySession(), ColumnFetcher::getOneTableColumnFragment(), ColumnFetcher::getResultSetColumn(), getRowCountAndOffsetForAllFrags(), INJECT_TIMER, RelAlgExecutionUnit::input_col_descs, RelAlgExecutionUnit::input_descs, interrupted_, ColumnFetcher::linearizeColumnFragments(), needFetchAllFragments(), needLinearizeAllFragments(), plan_state_, RESULT, anonymous_namespace{Execute.cpp}::try_get_column_descriptor(), and VLOG.
|
private |
Definition at line 3642 of file Execute.cpp.
References buildSelectedFragsMappingForUnion(), CHECK, CHECK_EQ, CHECK_LE, CHECK_LT, checkIsQuerySessionInterrupted(), Data_Namespace::CPU_LEVEL, DEBUG_TIMER, executor_session_mutex_, anonymous_namespace{Execute.cpp}::get_selected_input_col_descs(), anonymous_namespace{Execute.cpp}::get_selected_input_col_descs_index(), anonymous_namespace{Execute.cpp}::get_selected_input_descs_index(), ColumnFetcher::getAllTableColumnFragments(), getCurrentQuerySession(), ColumnFetcher::getOneTableColumnFragment(), ColumnFetcher::getResultSetColumn(), getRowCountAndOffsetForAllFrags(), INJECT_TIMER, RelAlgExecutionUnit::input_col_descs, RelAlgExecutionUnit::input_descs, needFetchAllFragments(), plan_state_, shared::printContainer(), RESULT, anonymous_namespace{Execute.cpp}::set_mod_range(), anonymous_namespace{Execute.cpp}::try_get_column_descriptor(), and VLOG.
|
private |
Definition at line 1540 of file NativeCodegen.cpp.
|
static |
Definition at line 5467 of file Execute.cpp.
References executor_resource_mgr_, and g_enable_executor_resource_mgr.
|
static |
Definition at line 5448 of file Execute.cpp.
References executor_resource_mgr_, and g_enable_executor_resource_mgr.
Referenced by foreign_storage::InternalExecutorStatsDataWrapper::initializeObjectsForTable().
|
static |
Definition at line 5438 of file Execute.cpp.
References executor_resource_mgr_, and g_enable_executor_resource_mgr.
|
inlineprivate |
Definition at line 1504 of file Execute.h.
References extension_modules_.
Referenced by get_geos_module(), get_libdevice_module(), get_rt_module(), get_rt_udf_module(), and get_udf_module().
|
inline |
Definition at line 545 of file Execute.h.
References get_extension_module(), and rt_geos_module.
|
inline |
Definition at line 548 of file Execute.h.
References get_extension_module(), and rt_libdevice_module.
|
inline |
Definition at line 532 of file Execute.h.
References get_extension_module(), and template_module.
|
inline |
Definition at line 539 of file Execute.h.
References get_extension_module(), register_runtime_extension_functions_mutex_, rt_udf_cpu_module, and rt_udf_gpu_module.
|
inline |
Definition at line 535 of file Execute.h.
References get_extension_module(), udf_cpu_module, and udf_gpu_module.
|
static |
Definition at line 562 of file Execute.cpp.
References g_is_test_env, and kArenaBlockOverhead.
Referenced by ResultSetLogicalValuesBuilder::create(), RelAlgExecutor::prepareLeafExecution(), and setupCaching().
|
inlinestatic |
Definition at line 1448 of file Execute.h.
References baseline_threshold, and GPU.
Referenced by GroupByAndAggregate::getColRangeInfo().
Executor::CachedCardinality Executor::getCachedCardinality | ( | const CardinalityCacheKey & | cache_key | ) |
Definition at line 5298 of file Execute.cpp.
References cardinality_cache_, g_use_estimator_result_cache, recycler_mutex_, and VLOG.
|
inline |
ExecutorResourceMgr_Namespace::ChunkRequestInfo Executor::getChunkRequestInfo | ( | const ExecutorDeviceType | device_type, |
const std::vector< InputDescriptor > & | input_descs, | ||
const std::vector< InputTableInfo > & | query_infos, | ||
const std::vector< std::pair< int32_t, FragmentsList >> & | device_fragment_lists | ||
) | const |
Determines a unique list of chunks and their associated byte sizes for a given query plan.
Called by Executor::launchKernelsViaResourceMgr
Note that we currently need the kernel's fragment lists generated in Executor::createKernels (which calls QueryFragmentDescriptor::buildFragmentKernelMap), but would be nice to hoist that logic out so that we could call this earlier, i.e. before compilation such that we don't waste compilation cycles in an attempt to run a query on GPU, only to see there are insufficient resources for it and it must be kicked to CPU
Note this method currently has two key limitations:
device_type | - specifies whether the query needs CPU or GPU buffer pool memory |
input_descs | - tables needed by the query |
query_infos | |
kernel_fragment_lists |
Definition at line 877 of file Execute.cpp.
References gpu_enabled::accumulate(), CPU, and getColumnByteWidthMap().
Referenced by launchKernelsViaResourceMgr().
std::vector< ColumnLazyFetchInfo > Executor::getColLazyFetchInfo | ( | const std::vector< Analyzer::Expr * > & | target_exprs | ) | const |
Definition at line 1017 of file Execute.cpp.
References CHECK, get_column_descriptor(), get_column_descriptor_maybe(), IS_GEO, kNULLT, and plan_state_.
Referenced by createKernels().
ExpressionRange Executor::getColRange | ( | const PhysicalInput & | phys_input | ) | const |
Definition at line 746 of file Execute.cpp.
References agg_col_range_cache_, and AggregatedColRange::getColRange().
std::map< shared::ColumnKey, size_t > Executor::getColumnByteWidthMap | ( | const std::set< shared::TableKey > & | table_ids_to_fetch, |
const bool | include_lazy_fetched_cols | ||
) | const |
Definition at line 819 of file Execute.cpp.
References CHECK, anonymous_namespace{Execute.cpp}::get_col_byte_width(), and plan_state_.
Referenced by getChunkRequestInfo().
const ColumnDescriptor * Executor::getColumnDescriptor | ( | const Analyzer::ColumnVar * | col_var | ) | const |
Definition at line 711 of file Execute.cpp.
References get_column_descriptor_maybe(), and Analyzer::ColumnVar::getColumnKey().
Referenced by getPhysicalColumnDescriptor().
|
inline |
QuerySessionId & Executor::getCurrentQuerySession | ( | heavyai::shared_lock< heavyai::shared_mutex > & | read_lock | ) |
Definition at line 4986 of file Execute.cpp.
References current_query_session_.
Referenced by executePlanWithGroupBy(), executePlanWithoutGroupBy(), executeWorkUnitImpl(), fetchChunks(), and fetchUnionChunks().
|
inline |
Definition at line 623 of file Execute.h.
References CHECK, and data_mgr_.
Referenced by getDeviceTypeForTargets(), logSystemCPUMemoryStatus(), and logSystemGPUMemoryStatus().
heavyai::shared_mutex & Executor::getDataRecyclerLock | ( | ) |
|
private |
Definition at line 2575 of file Execute.cpp.
References CPU, g_bigint_count, get_target_info(), getDataMgr(), RelAlgExecutionUnit::groupby_exprs, isArchPascalOrLater(), kAVG, kDOUBLE, kSUM, kSUM_IF, and RelAlgExecutionUnit::target_exprs.
Referenced by executeWorkUnitImpl().
|
static |
Definition at line 513 of file Execute.cpp.
References CHECK, SystemParameters::cuda_block_size, SystemParameters::cuda_grid_size, executors_, executors_cache_mutex_, Catalog_Namespace::SysCatalog::getDataMgr(), Catalog_Namespace::SysCatalog::instance(), and SystemParameters::max_gpu_slab_size.
Referenced by ResultSetReductionJIT::codegen(), GpuReductionHelperJIT::codegen(), ColumnarResults::ColumnarResults(), Parser::OptimizeTableStmt::execute(), Parser::CopyTableStmt::execute(), Parser::InsertValuesStmt::execute(), DBHandler::execute_rel_alg(), QueryRunner::QueryRunner::extractQueryPlanDag(), StubGenerator::generateStub(), DBHandler::get_queries_info(), QueryRunner::QueryRunner::getCalcitePlan(), Fragmenter_Namespace::FragmentInfo::getChunkMetadataMap(), QueryRunner::QueryRunner::getExecutor(), CgenState::getExecutor(), Parser::LocalQueryConnector::getOuterFragmentCount(), QueryRunner::QueryRunner::getParsedGlobalQueryHints(), QueryRunner::QueryRunner::getParsedQueryHint(), QueryRunner::QueryRunner::getParsedQueryHints(), DBHandler::getQueries(), QueryRunner::QueryRunner::getQueryInfoForDataRecyclerTest(), QueryRunner::QueryRunner::getRaExecutionSequence(), QueryRunner::QueryRunner::getRelAlgDag(), QueryRunner::QueryRunner::getRootNodeFromParsedQuery(), DBHandler::import_table(), import_export::Importer::importDelimited(), import_export::Importer::importGDALGeo(), import_export::Importer::importGDALRaster(), DBHandler::importGeoTableSingle(), DBHandler::interrupt(), DBHandler::interruptQuery(), DBHandler::invalidate_cur_session(), anonymous_namespace{DBHandler.cpp}::log_cache_size(), migrations::MigrationMgr::migrateDateInDaysMetadata(), Parser::InsertIntoTableAsSelectStmt::populateData(), Parser::LocalQueryConnector::query(), ResultSetStorage::reduceEntriesNoCollisionsColWise(), QueryRunner::anonymous_namespace{QueryRunner.cpp}::run_select_query_with_filter_push_down(), QueryRunner::QueryRunner::runSelectQuery(), QueryRunner::QueryRunner::runSQLWithAllowingInterrupt(), DBHandler::set_cur_session(), DBHandler::sql_execute_impl(), and anonymous_namespace{DdlCommandExecutor.cpp}::vacuum_table_if_required().
|
inline |
Definition at line 1332 of file Execute.h.
References executor_id_.
Referenced by launchKernelsViaResourceMgr().
const std::vector< size_t > Executor::getExecutorIdsRunningQuery | ( | const QuerySessionId & | interrupt_session | ) | const |
Definition at line 5347 of file Execute.cpp.
References executor_session_mutex_, queries_session_map_, and run_benchmark_import::res.
|
private |
Definition at line 732 of file WindowFunctionIR.cpp.
References Analyzer::WindowFunction::getOrderKeys(), and WindowFunctionContext::getWindowFunction().
|
private |
Definition at line 3760 of file Execute.cpp.
References RelAlgExecutionUnit::input_descs, RelAlgExecutionUnit::join_quals, and plan_state_.
Referenced by buildSelectedFragsMapping().
|
private |
Definition at line 847 of file WindowFunctionIR.cpp.
|
private |
|
private |
Definition at line 4253 of file Execute.cpp.
References CHECK, GPU, and plan_state_.
Referenced by executePlanWithGroupBy(), and executePlanWithoutGroupBy().
const StringDictionaryProxy::IdMap * Executor::getJoinIntersectionStringProxyTranslationMap | ( | const StringDictionaryProxy * | source_proxy, |
StringDictionaryProxy * | dest_proxy, | ||
const std::vector< StringOps_Namespace::StringOpInfo > & | source_string_op_infos, | ||
const std::vector< StringOps_Namespace::StringOpInfo > & | dest_source_string_op_infos, | ||
std::shared_ptr< RowSetMemoryOwner > | row_set_mem_owner | ||
) | const |
const QueryPlanDAG Executor::getLatestQueryPlanDagExtracted | ( | ) | const |
Definition at line 5382 of file Execute.cpp.
References latest_query_plan_extracted_, and recycler_mutex_.
size_t Executor::getNumBytesForFetchedRow | ( | const std::set< shared::TableKey > & | table_keys_to_fetch | ) | const |
size_t Executor::getNumBytesForFetchedRow | ( | const std::set< int > & | table_ids_to_fetch | ) | const |
size_t Executor::getNumCurentSessionsEnrolled | ( | ) | const |
Definition at line 5115 of file Execute.cpp.
References executor_session_mutex_, and queries_session_map_.
|
private |
Definition at line 738 of file WindowFunctionIR.cpp.
|
private |
Definition at line 743 of file WindowFunctionIR.cpp.
References CHECK, anonymous_namespace{WindowFunctionIR.cpp}::get_col_type_name_by_size(), Analyzer::WindowFunction::getOrderKeys(), and WindowFunctionContext::getWindowFunction().
const ColumnDescriptor * Executor::getPhysicalColumnDescriptor | ( | const Analyzer::ColumnVar * | col_var, |
int | n | ||
) | const |
Definition at line 716 of file Execute.cpp.
References shared::ColumnKey::column_id, get_column_descriptor_maybe(), getColumnDescriptor(), Analyzer::ColumnVar::getColumnKey(), and anonymous_namespace{Utm.h}::n.
|
inline |
QueryPlanDagCache & Executor::getQueryPlanDagCache | ( | ) |
Definition at line 4974 of file Execute.cpp.
References query_plan_dag_cache_.
std::vector< QuerySessionStatus > Executor::getQuerySessionInfo | ( | const QuerySessionId & | query_session, |
heavyai::shared_lock< heavyai::shared_mutex > & | read_lock | ||
) |
QuerySessionStatus::QueryStatus Executor::getQuerySessionStatus | ( | const QuerySessionId & | candidate_query_session, |
heavyai::shared_lock< heavyai::shared_mutex > & | read_lock | ||
) |
ResultSetRecyclerHolder & Executor::getResultSetRecyclerHolder | ( | ) |
Definition at line 4978 of file Execute.cpp.
References resultset_recycler_holder_.
|
private |
Definition at line 3367 of file Execute.cpp.
References CHECK, CHECK_EQ, CHECK_LT, get_table_id_to_frag_offsets(), RelAlgExecutionUnit::join_quals, plan_state_, and RelAlgExecutionUnit::union_all.
Referenced by fetchChunks(), and fetchUnionChunks().
const std::shared_ptr< RowSetMemoryOwner > Executor::getRowSetMemoryOwner | ( | ) | const |
Definition at line 728 of file Execute.cpp.
References row_set_mem_owner_.
Referenced by executeTableFunction(), TransientStringLiteralsVisitor::visitStringOper(), and TransientStringLiteralsVisitor::visitUOper().
heavyai::shared_mutex & Executor::getSessionLock | ( | ) |
Definition at line 4982 of file Execute.cpp.
References executor_session_mutex_.
|
inline |
Returns a string dictionary proxy using the currently active row set memory owner.
Definition at line 578 of file Execute.h.
References CHECK, and row_set_mem_owner_.
Referenced by addTransientStringLiterals(), and serializeLiterals().
StringDictionaryProxy* Executor::getStringDictionaryProxy | ( | const shared::StringDictKey & | dict_key, |
const std::shared_ptr< RowSetMemoryOwner > | row_set_mem_owner, | ||
const bool | with_generation | ||
) | const |
const StringDictionaryProxy::TranslationMap< Datum > * Executor::getStringProxyNumericTranslationMap | ( | const shared::StringDictKey & | source_dict_key, |
const std::vector< StringOps_Namespace::StringOpInfo > & | string_op_infos, | ||
std::shared_ptr< RowSetMemoryOwner > | row_set_mem_owner, | ||
const bool | with_generation | ||
) | const |
const StringDictionaryProxy::IdMap * Executor::getStringProxyTranslationMap | ( | const shared::StringDictKey & | source_dict_key, |
const shared::StringDictKey & | dest_dict_key, | ||
const RowSetMemoryOwner::StringTranslationType | translation_type, | ||
const std::vector< StringOps_Namespace::StringOpInfo > & | string_op_infos, | ||
std::shared_ptr< RowSetMemoryOwner > | row_set_mem_owner, | ||
const bool | with_generation | ||
) | const |
Definition at line 606 of file Execute.cpp.
References CHECK, and str_dict_mutex_.
Referenced by TransientStringLiteralsVisitor::visitStringOper(), and TransientStringLiteralsVisitor::visitUOper().
|
private |
Definition at line 3236 of file Execute.cpp.
References CHECK, CHECK_LT, RelAlgExecutionUnit::input_descs, and skipFragmentPair().
const TableGeneration & Executor::getTableGeneration | ( | const shared::TableKey & | table_key | ) | const |
Definition at line 741 of file Execute.cpp.
References TableGenerations::getGeneration(), and table_generations_.
Referenced by skipFragment().
Fragmenter_Namespace::TableInfo Executor::getTableInfo | ( | const shared::TableKey & | table_key | ) | const |
Definition at line 736 of file Execute.cpp.
References InputTableInfoCache::getTableInfo(), and input_table_info_cache_.
Referenced by computeColRangesCache(), and computeTableGenerations().
|
inline |
Returns pointer to the intermediate tables vector currently stored by this executor.
Definition at line 573 of file Execute.h.
References temporary_tables_.
Referenced by skipFragmentPair().
const TemporaryTables* Executor::getTemporaryTables | ( | ) | const |
|
private |
Definition at line 1624 of file Execute.cpp.
References gpu_enabled::accumulate(), and run_benchmark_import::result.
Referenced by reduceMultiDeviceResults().
unsigned Executor::gridSize | ( | ) | const |
Definition at line 4352 of file Execute.cpp.
References CHECK, data_mgr_, Data_Namespace::DataMgr::getCudaMgr(), and grid_size_x_.
Referenced by collectAllDeviceShardedTopResults(), executePlanWithGroupBy(), executePlanWithoutGroupBy(), executeTableFunction(), executeWorkUnitImpl(), reduceMultiDeviceResults(), reduceMultiDeviceResultSets(), and resultsUnion().
|
private |
Definition at line 1384 of file IRCodegen.cpp.
References AUTOMATIC_IR_METADATA, CHECK, CHECK_GE, CodeGenerator::codegen(), CompilationOptions::device_type, get_int_type(), Analyzer::Expr::get_type_info(), kDOUBLE, kUNNEST, log2_bytes(), need_patch_unnest_double(), numeric_type_name(), DiamondCodegen::orig_cond_false_, CodeGenerator::posArg(), and DiamondCodegen::setFalseTarget().
|
inlineprivate |
Definition at line 1513 of file Execute.h.
References extension_modules_.
Referenced by has_geos_module(), has_libdevice_module(), has_rt_module(), has_rt_udf_module(), and has_udf_module().
|
inline |
Definition at line 563 of file Execute.h.
References has_extension_module(), and rt_geos_module.
|
inline |
Definition at line 566 of file Execute.h.
References has_extension_module(), and rt_libdevice_module.
|
inline |
Definition at line 552 of file Execute.h.
References has_extension_module(), and template_module.
|
inline |
Definition at line 559 of file Execute.h.
References has_extension_module(), rt_udf_cpu_module, and rt_udf_gpu_module.
|
inline |
Definition at line 555 of file Execute.h.
References has_extension_module(), udf_cpu_module, and udf_gpu_module.
bool Executor::hasLazyFetchColumns | ( | const std::vector< Analyzer::Expr * > & | target_exprs | ) | const |
|
static |
Definition at line 5387 of file Execute.cpp.
References executor_resource_mgr_, and ExecutorResourceMgr_Namespace::generate_executor_resource_mgr().
Referenced by DBHandler::init_executor_resource_mgr(), and QueryRunner::QueryRunner::QueryRunner().
|
static |
Definition at line 298 of file Execute.cpp.
References CHECK, extension_module_sources, get_cuda_libdevice_dir(), heavyai::get_root_abs_path(), LOG, rt_geos_module, rt_libdevice_module, template_module, and logger::WARNING.
Referenced by input_table_info_cache_().
|
private |
Definition at line 1545 of file NativeCodegen.cpp.
|
private |
Definition at line 2373 of file NativeCodegen.cpp.
|
private |
Definition at line 3242 of file NativeCodegen.cpp.
void Executor::interrupt | ( | const QuerySessionId & | query_session = "" , |
const QuerySessionId & | interrupt_session = "" |
||
) |
Definition at line 42 of file GpuInterrupt.cpp.
References CHECK, CHECK_EQ, CHECK_GE, check_interrupt_init(), checkCudaErrors(), data_mgr_(), DW_ABORT, dw_abort, dynamic_watchdog_init(), g_enable_dynamic_watchdog, g_enable_non_kernel_time_query_interrupt, g_enable_runtime_query_interrupt, INT_ABORT, runtime_interrupt_flag, to_string(), and VLOG.
|
static |
Definition at line 5316 of file Execute.cpp.
References cardinality_cache_, g_use_estimator_result_cache, and recycler_mutex_.
Referenced by clearExternalCaches().
void Executor::invalidateRunningQuerySession | ( | heavyai::unique_lock< heavyai::shared_mutex > & | write_lock | ) |
Definition at line 5013 of file Execute.cpp.
References current_query_session_.
Referenced by clearQuerySessionStatus().
bool Executor::isArchMaxwell | ( | const ExecutorDeviceType | dt | ) | const |
|
inlineprivate |
Definition at line 872 of file Execute.h.
References cudaMgr(), GPU, and CudaMgr_Namespace::CudaMgr::isArchPascalOrLater().
Referenced by getDeviceTypeForTargets().
bool Executor::isCPUOnly | ( | ) | const |
Definition at line 706 of file Execute.cpp.
References CHECK, data_mgr_, and Data_Namespace::DataMgr::getCudaMgr().
|
private |
Definition at line 4561 of file Execute.cpp.
References CHECK, extract_max_stat_int_type(), extract_min_stat_int_type(), Catalog_Namespace::SysCatalog::getCatalog(), Fragmenter_Namespace::FragmentInfo::getChunkMetadataMap(), InputDescriptor::getTableKey(), Catalog_Namespace::SysCatalog::instance(), and Fragmenter_Namespace::FragmentInfo::physicalTableId.
Referenced by skipFragment().
|
private |
Launches execution kernels created by createKernels
asynchronously using a thread pool.
Definition at line 3040 of file Execute.cpp.
References SharedKernelContext::addDeviceResults(), auto_num_threads, CHECK, CPU, cpu_threads(), DEBUG_TIMER_NEW_THREAD, RelAlgExecutionUnit::estimator, logger::EXECUTOR, g_enable_cpu_sub_tasks, LOG, threading_std::task_group::run(), SharedKernelContext::setNumAllocatedThreads(), logger::thread_local_ids(), VLOG, and threading_std::task_group::wait().
Referenced by launchKernelsLocked(), and launchKernelsViaResourceMgr().
|
private |
Definition at line 3123 of file Execute.cpp.
References auto_num_threads, kernel_mutex_, kernel_queue_time_ms_, launchKernelsImpl(), timer_start(), and timer_stop().
Referenced by executeWorkUnitImpl().
|
private |
Launches a vector of kernels for a given query step, gated/scheduled by ExecutorResourceMgr.
This function first calculates the neccessary CPU, GPU, result set memory and buffer pool memory neccessary for the query, which it then requests from ExecutorResourceMgr. The query thread will be conditionally put into a wait state until there are enough resources to execute the query, which might or might not be concurrently with other query steps, depending on the resource grant policies in place and the resources needed by this thread's query step and all other in-flight queries requesting resources. After the thread is given the green light by ExecutorResourceMgr, it then calls launchKernelsImpl which does the actual work of launching the kernels.
shared_context | - used to obtain InputTableInfo vector (query_infos) used for input chunk calculation |
kernels | - vector of kernels that will be launched, one per fragment for CPU execution, but can be multi-fragment (one per device) for GPU execution |
device_type | - specifies whether the query step should run on CPU or GPU |
input_descs | - neccessary to get the input table and column ids for a query for input chunk calculation |
query_mem_desc | - neccessary to get result set size per kernel |
Definition at line 3135 of file Execute.cpp.
References ExecutorResourceMgr_Namespace::CPU_SLOTS, executor_resource_mgr_, QueryMemoryDescriptor::getBufferSizeBytes(), getChunkRequestInfo(), getExecutorId(), SharedKernelContext::getQueryInfos(), GPU, ExecutorResourceMgr_Namespace::GPU_SLOTS, kernel_queue_time_ms_, launchKernelsImpl(), query_mem_desc, QueryMemoryDescriptor::threadsCanReuseGroupByBuffers(), timer_start(), timer_stop(), and VLOG.
Referenced by executeWorkUnitImpl().
void Executor::logSystemCPUMemoryStatus | ( | std::string const & | tag, |
size_t const | thread_idx | ||
) | const |
Definition at line 765 of file Execute.cpp.
References executor_id_, g_allow_memory_status_log, getDataMgr(), Data_Namespace::DataMgr::getSystemMemoryUsage(), anonymous_namespace{Execute.cpp}::log_system_memory_info_impl(), timer_start(), and timer_stop().
void Executor::logSystemGPUMemoryStatus | ( | std::string const & | tag, |
size_t const | thread_idx | ||
) | const |
Definition at line 776 of file Execute.cpp.
References executor_id_, g_allow_memory_status_log, Data_Namespace::DataMgr::getCudaMgr(), getDataMgr(), anonymous_namespace{Execute.cpp}::log_system_memory_info_impl(), timer_start(), and timer_stop().
size_t Executor::maxGpuSlabSize | ( | ) | const |
|
private |
Definition at line 3416 of file Execute.cpp.
References CHECK_EQ, CHECK_LT, InputDescriptor::getNestLevel(), InputColDescriptor::getScanDesc(), InputDescriptor::getSourceType(), InputDescriptor::getTableKey(), RelAlgExecutionUnit::input_descs, RelAlgExecutionUnit::join_quals, plan_state_, and TABLE.
Referenced by fetchChunks(), and fetchUnionChunks().
|
private |
Definition at line 3435 of file Execute.cpp.
References CHECK_EQ, CHECK_LT, ColumnDescriptor::columnType, InputDescriptor::getNestLevel(), InputColDescriptor::getScanDesc(), InputDescriptor::getTableKey(), SQLTypeInfo::is_array(), SQLTypeInfo::is_dict_encoded_type(), and SQLTypeInfo::is_string().
Referenced by fetchChunks().
|
inlinestatic |
Definition at line 505 of file Execute.h.
References execute_mutex_, executors_, and executors_cache_mutex_.
|
private |
Definition at line 4268 of file Execute.cpp.
References cgen_state_, compilation_queue_time_ms_, RelAlgExecutionUnit::join_quals, kernel_queue_time_ms_, LEFT, and plan_state_.
unsigned Executor::numBlocksPerMP | ( | ) | const |
Definition at line 4361 of file Execute.cpp.
References shared::ceil_div(), cudaMgr(), and grid_size_x_.
|
private |
Definition at line 487 of file NativeCodegen.cpp.
References QueryEngine::getInstance(), logger::INFO, CodeGenerator::link_udf_module(), LOG, serialize_llvm_object(), and to_string().
|
private |
Definition at line 1395 of file NativeCodegen.cpp.
|
static |
Definition at line 5420 of file Execute.cpp.
References executor_resource_mgr_, and g_enable_executor_resource_mgr.
Referenced by anonymous_namespace{DBHandler.cpp}::pause_and_resume_executor_queue(), and DBHandler::pause_executor_queue().
|
private |
Definition at line 4288 of file Execute.cpp.
References AUTOMATIC_IR_METADATA, cgen_state_, CHECK_LT, and get_arg_by_name().
|
private |
Definition at line 875 of file WindowFunctionIR.cpp.
References WindowFrameBoundFuncArgs::current_col_value_lv, WindowFrameBoundFuncArgs::frame_end_bound_expr_lv, WindowFrameBoundFuncArgs::frame_start_bound_expr_lv, WindowFrameBoundFuncArgs::int64_t_zero_val_lv, Analyzer::WindowFrame::isCurrentRowBound(), WindowFrameBoundFuncArgs::null_end_pos_lv, WindowFrameBoundFuncArgs::null_start_pos_lv, WindowFrameBoundFuncArgs::nulls_first_lv, WindowFrameBoundFuncArgs::num_elem_current_partition_lv, WindowFrameBoundFuncArgs::order_key_buf_ptr_lv, WindowFrameBoundFuncArgs::target_partition_rowid_ptr_lv, and WindowFrameBoundFuncArgs::target_partition_sorted_rowid_ptr_lv.
|
private |
Definition at line 857 of file WindowFunctionIR.cpp.
References WindowFrameBoundFuncArgs::current_partition_start_offset_lv, CURRENT_ROW, WindowFrameBoundFuncArgs::current_row_pos_lv, EXPR_FOLLOWING, WindowFrameBoundFuncArgs::frame_end_bound_expr_lv, WindowFrameBoundFuncArgs::frame_start_bound_expr_lv, WindowFrameBoundFuncArgs::int64_t_zero_val_lv, and WindowFrameBoundFuncArgs::num_elem_current_partition_lv.
|
private |
Definition at line 1087 of file IRCodegen.cpp.
References CHECK, CHECK_EQ, get_int_type(), and to_string().
|
private |
Definition at line 1589 of file Execute.cpp.
References blockSize(), CPU, DEBUG_TIMER, RelAlgExecutionUnit::estimator, ResultSet::fixupQueryMemoryDescriptor(), getUniqueThreadSharedResultSets(), gridSize(), QueryMemoryDescriptor, reduce_estimator_results(), reduceMultiDeviceResultSets(), RelAlgExecutionUnit::target_exprs, and QueryMemoryDescriptor::threadsCanReuseGroupByBuffers().
Referenced by collectAllDeviceResults().
|
private |
Definition at line 1664 of file Execute.cpp.
References gpu_enabled::accumulate(), blockSize(), CHECK, CPU, DEBUG_TIMER, executor_id_, anonymous_namespace{Execute.cpp}::get_reduction_code(), QueryMemoryDescriptor::getQueryDescriptionType(), gridSize(), heavyai::GroupByBaselineHash, logger::init(), plan_state_, query_mem_desc, and QueryMemoryDescriptor::setEntryCount().
Referenced by reduceMultiDeviceResults().
|
static |
Definition at line 1337 of file Execute.cpp.
References agg_max_double_skip_val(), agg_max_float_skip_val(), agg_max_skip_val(), agg_min_double_skip_val(), agg_min_float_skip_val(), agg_min_skip_val(), agg_sum_double_skip_val(), agg_sum_float_skip_val(), agg_sum_skip_val(), CHECK, float_to_double_bin(), SQLTypeInfo::get_notnull(), SQLTypeInfo::is_boolean(), SQLTypeInfo::is_decimal(), SQLTypeInfo::is_fp(), SQLTypeInfo::is_integer(), SQLTypeInfo::is_time(), kAVG, kCOUNT, kCOUNT_IF, kMAX, kMIN, kSAMPLE, kSINGLE_VALUE, kSUM, kSUM_IF, and UNREACHABLE.
Referenced by executePlanWithoutGroupBy().
|
private |
Definition at line 1724 of file Execute.cpp.
References SpeculativeTopNMap::asRows(), CHECK, CHECK_EQ, SortInfo::limit, SortInfo::offset, SortInfo::order_entries, SpeculativeTopNMap::reduce(), run_benchmark_import::result, report::rows, RelAlgExecutionUnit::sort_info, and RelAlgExecutionUnit::target_exprs.
Referenced by collectAllDeviceResults().
|
static |
Definition at line 20 of file GpuInterrupt.cpp.
References CHECK_LT, to_string(), and VLOG.
|
inlinestatic |
Definition at line 470 of file Execute.h.
References execute_mutex_, executors_, executors_cache_mutex_, register_runtime_extension_functions_mutex_, and update_after_registration().
Referenced by DBHandler::register_runtime_extension_functions().
void Executor::registerExtractedQueryPlanDag | ( | const QueryPlanDAG & | query_plan_dag | ) |
Definition at line 5376 of file Execute.cpp.
References latest_query_plan_extracted_.
bool Executor::removeFromQuerySessionList | ( | const QuerySessionId & | query_session, |
const std::string & | submitted_time_str, | ||
heavyai::unique_lock< heavyai::shared_mutex > & | write_lock | ||
) |
Definition at line 5209 of file Execute.cpp.
References executor_id_, interrupted_, queries_interrupt_flag_, and queries_session_map_.
Referenced by clearQuerySessionStatus().
void Executor::reset | ( | bool | discard_runtime_modules_only = false | ) |
Definition at line 327 of file Execute.cpp.
References QueryEngine::getInstance(), rt_udf_cpu_module, and rt_udf_gpu_module.
void Executor::resetBlockSize | ( | ) |
void Executor::resetGridSize | ( | ) |
void Executor::resetInterrupt | ( | ) |
Definition at line 216 of file GpuInterrupt.cpp.
References check_interrupt_init(), DW_RESET, dynamic_watchdog_init(), g_enable_dynamic_watchdog, g_enable_non_kernel_time_query_interrupt, g_enable_runtime_query_interrupt, INT_RESET, unregisterActiveModule(), and VLOG.
Referenced by clearQuerySessionStatus().
|
private |
Definition at line 1563 of file Execute.cpp.
References blockSize(), CHECK_GE, CPU, DEBUG_TIMER, anonymous_namespace{Execute.cpp}::get_merged_result(), SharedKernelContext::getFragmentResults(), gridSize(), QueryMemoryDescriptor, row_set_mem_owner_, gpu_enabled::sort(), and RelAlgExecutionUnit::target_exprs.
Referenced by executeWorkUnitImpl().
|
static |
Definition at line 5429 of file Execute.cpp.
References executor_resource_mgr_, and g_enable_executor_resource_mgr.
Referenced by anonymous_namespace{DBHandler.cpp}::pause_and_resume_executor_queue(), and DBHandler::resume_executor_queue().
|
private |
Definition at line 1060 of file Execute.cpp.
References CgenState::addAligned(), align(), CHECK, CHECK_EQ, CHECK_LE, g_enable_string_functions, StringDictionaryProxy::getIdOfString(), StringDictionaryProxy::getOrAddTransient(), getStringDictionaryProxy(), CgenState::literalBytes(), and row_set_mem_owner_.
Referenced by executePlanWithGroupBy(), and executePlanWithoutGroupBy().
|
static |
Definition at line 5477 of file Execute.cpp.
References executor_resource_mgr_, and g_enable_executor_resource_mgr.
|
static |
Definition at line 5456 of file Execute.cpp.
References executor_resource_mgr_, and g_enable_executor_resource_mgr.
void Executor::setBlockSize | ( | unsigned | block_size | ) |
|
inline |
void Executor::setGridSize | ( | unsigned | grid_size | ) |
void Executor::setQuerySessionAsInterrupted | ( | const QuerySessionId & | query_session, |
heavyai::unique_lock< heavyai::shared_mutex > & | write_lock | ||
) |
Definition at line 5243 of file Execute.cpp.
References queries_interrupt_flag_.
void Executor::setupCaching | ( | const std::unordered_set< PhysicalInput > & | phys_inputs, |
const std::unordered_set< shared::TableKey > & | phys_table_keys | ||
) |
Definition at line 4960 of file Execute.cpp.
References agg_col_range_cache_, computeColRangesCache(), computeStringDictionaryGenerations(), computeTableGenerations(), executor_id_, getArenaBlockSize(), row_set_mem_owner_, and table_generations_.
|
private |
Definition at line 4658 of file Execute.cpp.
References canSkipFragmentForFpQual(), CHECK, CodeGenerator::codegenIntConst(), DateTruncateHighPrecisionToDate(), extract_max_stat_int_type(), extract_min_stat_int_type(), get_column_descriptor(), anonymous_namespace{Execute.cpp}::get_hpt_overflow_underflow_safe_scaled_values(), Analyzer::BinOper::get_left_operand(), Fragmenter_Namespace::FragmentInfo::getChunkMetadataMap(), getTableGeneration(), InputDescriptor::getTableKey(), INVALID, isFragmentFullyDeleted(), kCAST, kEQ, kGE, kGT, kLE, kLT, kTIME, NOT_SKIPPABLE, Fragmenter_Namespace::FragmentInfo::physicalTableId, SKIPPABLE, to_string(), UNREACHABLE, and VLOG.
Referenced by skipFragmentInnerJoins().
|
private |
Definition at line 4861 of file Execute.cpp.
References INNER, RelAlgExecutionUnit::join_quals, qual_to_conjunctive_form(), and skipFragment().
|
private |
Definition at line 3278 of file Execute.cpp.
References CHECK, CHECK_EQ, get_shard_count(), BaselineJoinHashTable::getShardCountForCondition(), getTemporaryTables(), GPU, RelAlgExecutionUnit::input_descs, RelAlgExecutionUnit::join_quals, HashJoin::normalizeColumnPairs(), plan_state_, and Fragmenter_Namespace::FragmentInfo::shard.
Referenced by getTableFragmentIndices().
|
private |
Definition at line 19 of file MaxwellCodegenPatch.cpp.
|
static |
Definition at line 30 of file GpuInterrupt.cpp.
References CHECK_LT, to_string(), and VLOG.
Referenced by resetInterrupt().
|
inlinestatic |
Definition at line 1420 of file Execute.h.
References executors_.
Referenced by registerExtensionFunctions().
void Executor::update_extension_modules | ( | bool | update_runtime_modules_only = false | ) |
is_gpu=
is_gpu=
is_gpu=
is_gpu=
Definition at line 350 of file Execute.cpp.
References CHECK, extension_module_sources, LOG, read_llvm_module_from_bc_file(), read_llvm_module_from_ir_file(), read_llvm_module_from_ir_string(), rt_geos_module, rt_libdevice_module, rt_udf_cpu_module, rt_udf_gpu_module, template_module, toString(), udf_cpu_module, udf_gpu_module, UNREACHABLE, and logger::WARNING.
bool Executor::updateQuerySessionExecutorAssignment | ( | const QuerySessionId & | query_session, |
const std::string & | submitted_time_str, | ||
const size_t | executor_id, | ||
heavyai::unique_lock< heavyai::shared_mutex > & | write_lock | ||
) |
Definition at line 5184 of file Execute.cpp.
References queries_session_map_.
Referenced by attachExecutorToQuerySession().
void Executor::updateQuerySessionStatus | ( | const QuerySessionId & | query_session, |
const std::string & | submitted_time_str, | ||
const QuerySessionStatus::QueryStatus | new_query_status | ||
) |
Definition at line 5075 of file Execute.cpp.
References current_query_session_, executor_session_mutex_, and updateQuerySessionStatusWithLock().
Referenced by executeWorkUnitImpl().
bool Executor::updateQuerySessionStatusWithLock | ( | const QuerySessionId & | query_session, |
const std::string & | submitted_time_str, | ||
const QuerySessionStatus::QueryStatus | updated_query_status, | ||
heavyai::unique_lock< heavyai::shared_mutex > & | write_lock | ||
) |
Definition at line 5158 of file Execute.cpp.
References queries_session_map_.
Referenced by attachExecutorToQuerySession(), and updateQuerySessionStatus().
int8_t Executor::warpSize | ( | ) | const |
Definition at line 4344 of file Execute.cpp.
References CHECK, cudaMgr(), and CudaMgr_Namespace::CudaMgr::getAllDeviceProperties().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 1641 of file Execute.h.
Referenced by executeWorkUnitImpl(), reduceMultiDeviceResults(), and resultsUnion().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
private |
Definition at line 1572 of file Execute.h.
Referenced by clearMetaInfoCache(), dumpCache(), getColRange(), setColRangeCache(), and setupCaching().
|
static |
Definition at line 1626 of file Execute.h.
Referenced by DBHandler::init_executor_resource_mgr().
|
staticprivate |
Definition at line 1536 of file Execute.h.
Referenced by launchKernelsImpl(), and launchKernelsLocked().
|
staticprivate |
Definition at line 1549 of file Execute.h.
Referenced by getBaselineThreshold(), and ResultSet::sort().
|
private |
Definition at line 1552 of file Execute.h.
Referenced by blockSize(), resetBlockSize(), and setBlockSize().
|
staticprivate |
Definition at line 1607 of file Execute.h.
Referenced by addToCardinalityCache(), clearCardinalityCache(), getCachedCardinality(), and invalidateCardinalityCacheForTable().
|
private |
Definition at line 1502 of file Execute.h.
Referenced by castToFP(), castToIntPtrTyIn(), containsLeftDeepOuterJoin(), executeWorkUnit(), getCgenStatePtr(), nukeOldState(), preloadFragOffsets(), and Executor::CgenStateManager::~CgenStateManager().
|
private |
Definition at line 1563 of file Execute.h.
Referenced by executeWorkUnit(), and nukeOldState().
|
private |
Definition at line 1477 of file Execute.h.
Referenced by getContext().
|
private |
Definition at line 1576 of file Execute.h.
Referenced by checkCurrentQuerySession(), checkNonKernelTimeInterrupted(), clearQuerySessionStatus(), enrollQuerySession(), getCurrentQuerySession(), invalidateRunningQuerySession(), and updateQuerySessionStatus().
|
private |
Definition at line 1558 of file Execute.h.
Referenced by blockSize(), createKernels(), cudaMgr(), executeWorkUnitImpl(), getDataMgr(), gridSize(), and isCPUOnly().
|
staticprivate |
Definition at line 1585 of file Execute.h.
Referenced by acquireExecuteMutex(), clearMemory(), nukeCacheOfExecutors(), and registerExtensionFunctions().
|
private |
Definition at line 1476 of file Execute.h.
Referenced by acquireExecuteMutex(), attachExecutorToQuerySession(), checkNonKernelTimeInterrupted(), executeWorkUnit(), getExecutorId(), logSystemCPUMemoryStatus(), logSystemGPUMemoryStatus(), reduceMultiDeviceResultSets(), removeFromQuerySessionList(), and setupCaching().
|
static |
Definition at line 1628 of file Execute.h.
Referenced by get_concurrent_resource_grant_policy(), get_executor_resource_pool_info(), get_executor_resource_pool_total_resource_quantity(), init_resource_mgr(), launchKernelsViaResourceMgr(), pause_executor_queue(), resume_executor_queue(), set_concurrent_resource_grant_policy(), and set_executor_resource_pool_resource().
|
staticprivate |
Definition at line 1574 of file Execute.h.
Referenced by attachExecutorToQuerySession(), checkNonKernelTimeInterrupted(), checkPendingQueryStatus(), clearQuerySessionStatus(), enrollQuerySession(), executePlanWithGroupBy(), executePlanWithoutGroupBy(), executeWorkUnitImpl(), fetchChunks(), fetchUnionChunks(), getExecutorIdsRunningQuery(), getNumCurentSessionsEnrolled(), getSessionLock(), and updateQuerySessionStatus().
|
staticprivate |
Definition at line 1581 of file Execute.h.
Referenced by getExecutor(), nukeCacheOfExecutors(), registerExtensionFunctions(), and update_after_registration().
|
staticprivate |
Definition at line 1602 of file Execute.h.
Referenced by getExecutor(), nukeCacheOfExecutors(), and registerExtensionFunctions().
|
static |
Definition at line 528 of file Execute.h.
Referenced by initialize_extension_module_sources(), DBHandler::register_runtime_extension_functions(), and update_extension_modules().
|
private |
Definition at line 1517 of file Execute.h.
Referenced by get_extension_module(), and has_extension_module().
|
staticprivate |
|
staticprivate |
|
private |
|
private |
Definition at line 1553 of file Execute.h.
Referenced by gridSize(), numBlocksPerMP(), resetGridSize(), and setGridSize().
|
mutableprivate |
Definition at line 1571 of file Execute.h.
Referenced by clearMetaInfoCache(), and getTableInfo().
|
private |
Definition at line 1543 of file Execute.h.
Referenced by buildHashTableForQualifier(), executePlanWithGroupBy(), executePlanWithoutGroupBy(), executeWorkUnitImpl(), fetchChunks(), and removeFromQuerySessionList().
|
static |
Definition at line 424 of file Execute.h.
Referenced by CgenState::getExecutor().
|
static |
Definition at line 1624 of file Execute.h.
Referenced by executeWorkUnitPerFragment(), and launchKernelsLocked().
|
private |
Definition at line 1562 of file Execute.h.
Referenced by executeWorkUnit(), executeWorkUnitPerFragment(), launchKernelsLocked(), launchKernelsViaResourceMgr(), and nukeOldState().
|
staticprivate |
Definition at line 1612 of file Execute.h.
Referenced by getLatestQueryPlanDagExtracted(), and registerExtractedQueryPlanDag().
|
staticprivate |
Definition at line 1535 of file Execute.h.
Referenced by ExecutionKernel::runImpl().
|
private |
Definition at line 1554 of file Execute.h.
Referenced by maxGpuSlabSize().
|
mutableprivate |
|
private |
Definition at line 1532 of file Execute.h.
Referenced by buildSelectedFragsMapping(), createKernels(), executeWorkUnit(), executeWorkUnitImpl(), fetchChunks(), fetchUnionChunks(), getColLazyFetchInfo(), getColumnByteWidthMap(), getFragmentCount(), getInnerTabIdToJoinCond(), getJoinHashTablePtrs(), getPlanStatePtr(), getRowCountAndOffsetForAllFrags(), hasLazyFetchColumns(), needFetchAllFragments(), nukeOldState(), reduceMultiDeviceResultSets(), and skipFragmentPair().
|
staticprivate |
Definition at line 1578 of file Execute.h.
Referenced by addToQuerySessionList(), checkIsQuerySessionInterrupted(), checkNonKernelTimeInterrupted(), checkPendingQueryStatus(), removeFromQuerySessionList(), and setQuerySessionAsInterrupted().
|
staticprivate |
Definition at line 1580 of file Execute.h.
Referenced by addToQuerySessionList(), checkIsQuerySessionEnrolled(), checkPendingQueryStatus(), getExecutorIdsRunningQuery(), getNumCurentSessionsEnrolled(), getQuerySessionInfo(), getQuerySessionStatus(), removeFromQuerySessionList(), updateQuerySessionExecutorAssignment(), and updateQuerySessionStatusWithLock().
|
staticprivate |
Definition at line 1604 of file Execute.h.
Referenced by getQueryPlanDagCache().
|
staticprivate |
Definition at line 1605 of file Execute.h.
Referenced by addToCardinalityCache(), clearCardinalityCache(), getCachedCardinality(), getDataRecyclerLock(), getLatestQueryPlanDagExtracted(), and invalidateCardinalityCacheForTable().
|
static |
Definition at line 1623 of file Execute.h.
Referenced by get_rt_udf_module(), and registerExtensionFunctions().
|
staticprivate |
Definition at line 1608 of file Execute.h.
Referenced by getResultSetRecyclerHolder().
|
private |
Definition at line 1533 of file Execute.h.
Referenced by dumpCache(), executeWorkUnit(), executeWorkUnitImpl(), getRowSetMemoryOwner(), getStringDictionaryProxy(), resultsUnion(), serializeLiterals(), and setupCaching().
|
mutableprivate |
Definition at line 1545 of file Execute.h.
Referenced by getJoinIntersectionStringProxyTranslationMap(), getStringProxyNumericTranslationMap(), and getStringProxyTranslationMap().
|
private |
Definition at line 1573 of file Execute.h.
Referenced by clearMetaInfoCache(), dumpCache(), getTableGeneration(), and setupCaching().
|
private |
|
private |
Definition at line 1559 of file Execute.h.
Referenced by getTemporaryTables().
|
static |
Definition at line 423 of file Execute.h.
Referenced by acquireExecuteMutex(), checkNonKernelTimeInterrupted(), Parser::OptimizeTableStmt::execute(), Parser::CopyTableStmt::execute(), Parser::InsertValuesStmt::execute(), DBHandler::execute_rel_alg(), QueryRunner::QueryRunner::extractQueryPlanDag(), DBHandler::get_queries_info(), Fragmenter_Namespace::FragmentInfo::getChunkMetadataMap(), QueryRunner::QueryRunner::getExecutor(), Parser::LocalQueryConnector::getOuterFragmentCount(), QueryRunner::QueryRunner::getParsedGlobalQueryHints(), QueryRunner::QueryRunner::getParsedQueryHint(), QueryRunner::QueryRunner::getParsedQueryHints(), DBHandler::getQueries(), QueryRunner::QueryRunner::getQueryInfoForDataRecyclerTest(), QueryRunner::QueryRunner::getRaExecutionSequence(), QueryRunner::QueryRunner::getRootNodeFromParsedQuery(), DBHandler::import_table(), import_export::Importer::importDelimited(), import_export::Importer::importGDALGeo(), import_export::Importer::importGDALRaster(), DBHandler::importGeoTableSingle(), DBHandler::interrupt(), DBHandler::interruptQuery(), DBHandler::invalidate_cur_session(), anonymous_namespace{DBHandler.cpp}::log_cache_size(), migrations::MigrationMgr::migrateDateInDaysMetadata(), Parser::InsertIntoTableAsSelectStmt::populateData(), Parser::LocalQueryConnector::query(), QueryRunner::anonymous_namespace{QueryRunner.cpp}::run_select_query_with_filter_push_down(), QueryRunner::QueryRunner::runSQLWithAllowingInterrupt(), DBHandler::set_cur_session(), DBHandler::sql_execute_impl(), and anonymous_namespace{DdlCommandExecutor.cpp}::vacuum_table_if_required().
|
private |