OmniSciDB
94e8789169
|
#include <QueryFragmentDescriptor.h>
Public Member Functions | |
QueryFragmentDescriptor (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< InputTableInfo > &query_infos, const std::vector< Data_Namespace::MemoryInfo > &gpu_mem_infos, const double gpu_input_mem_limit_percent, const std::vector< size_t > allowed_outer_fragment_indices) | |
void | buildFragmentKernelMap (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< uint64_t > &frag_offsets, const int device_count, const ExecutorDeviceType &device_type, const bool enable_multifrag_kernels, const bool enable_inner_join_fragment_skipping, Executor *executor) |
template<typename DISPATCH_FCN > | |
void | assignFragsToMultiDispatch (DISPATCH_FCN f) const |
template<typename DISPATCH_FCN > | |
void | assignFragsToKernelDispatch (DISPATCH_FCN f, const RelAlgExecutionUnit &ra_exe_unit) const |
bool | shouldCheckWorkUnitWatchdog () const |
Static Public Member Functions | |
static void | computeAllTablesFragments (std::map< int, const TableFragments * > &all_tables_fragments, const RelAlgExecutionUnit &ra_exe_unit, const std::vector< InputTableInfo > &query_infos) |
Protected Member Functions | |
void | buildFragmentPerKernelMapForUnion (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< uint64_t > &frag_offsets, const int device_count, const size_t num_bytes_for_row, const ExecutorDeviceType &device_type, Executor *executor) |
void | buildFragmentPerKernelMap (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< uint64_t > &frag_offsets, const int device_count, const size_t num_bytes_for_row, const ExecutorDeviceType &device_type, Executor *executor) |
void | buildMultifragKernelMap (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< uint64_t > &frag_offsets, const int device_count, const size_t num_bytes_for_row, const ExecutorDeviceType &device_type, const bool enable_inner_join_fragment_skipping, Executor *executor) |
void | buildFragmentPerKernelForTable (const TableFragments *fragments, const RelAlgExecutionUnit &ra_exe_unit, const InputDescriptor &table_desc, const bool is_temporary_table, const std::vector< uint64_t > &frag_offsets, const int device_count, const size_t num_bytes_for_row, const ChunkMetadataVector &deleted_chunk_metadata_vec, const std::optional< size_t > table_desc_offset, const ExecutorDeviceType &device_type, Executor *executor) |
bool | terminateDispatchMaybe (size_t &tuple_count, const RelAlgExecutionUnit &ra_exe_unit, const ExecutionKernelDescriptor &kernel) const |
void | checkDeviceMemoryUsage (const Fragmenter_Namespace::FragmentInfo &fragment, const int device_id, const size_t num_cols) |
Protected Attributes | |
std::vector< size_t > | allowed_outer_fragment_indices_ |
size_t | outer_fragments_size_ = 0 |
int64_t | rowid_lookup_key_ = -1 |
std::map< int, const TableFragments * > | selected_tables_fragments_ |
std::map< int, std::vector < ExecutionKernelDescriptor > > | execution_kernels_per_device_ |
double | gpu_input_mem_limit_percent_ |
std::map< size_t, size_t > | tuple_count_per_device_ |
std::map< size_t, size_t > | available_gpu_mem_bytes_ |
Definition at line 67 of file QueryFragmentDescriptor.h.
QueryFragmentDescriptor::QueryFragmentDescriptor | ( | const RelAlgExecutionUnit & | ra_exe_unit, |
const std::vector< InputTableInfo > & | query_infos, | ||
const std::vector< Data_Namespace::MemoryInfo > & | gpu_mem_infos, | ||
const double | gpu_input_mem_limit_percent, | ||
const std::vector< size_t > | allowed_outer_fragment_indices | ||
) |
Definition at line 25 of file QueryFragmentDescriptor.cpp.
References available_gpu_mem_bytes_, CHECK_EQ, RelAlgExecutionUnit::input_descs, and selected_tables_fragments_.
|
inline |
Dispatch one fragment for each device. Iterate the device map and dispatch one kernel for each device per iteration. This allows balanced dispatch as well as early termination if the number of rows passing the kernel can be computed at dispatch time and the scan limit is reached.
Definition at line 110 of file QueryFragmentDescriptor.h.
References CHECK, execution_kernels_per_device_, generate_TableFunctionsFactory_init::f, rowid_lookup_key_, and terminateDispatchMaybe().
|
inline |
Dispatch multi-fragment kernels. Currently GPU only. Each GPU should have only one kernel, with multiple fragments in its fragments list.
Definition at line 93 of file QueryFragmentDescriptor.h.
References CHECK_EQ, execution_kernels_per_device_, generate_TableFunctionsFactory_init::f, and rowid_lookup_key_.
void QueryFragmentDescriptor::buildFragmentKernelMap | ( | const RelAlgExecutionUnit & | ra_exe_unit, |
const std::vector< uint64_t > & | frag_offsets, | ||
const int | device_count, | ||
const ExecutorDeviceType & | device_type, | ||
const bool | enable_multifrag_kernels, | ||
const bool | enable_inner_join_fragment_skipping, | ||
Executor * | executor | ||
) |
Definition at line 64 of file QueryFragmentDescriptor.cpp.
References buildFragmentPerKernelMap(), buildFragmentPerKernelMapForUnion(), buildMultifragKernelMap(), RelAlgExecutionUnit::input_descs, and RelAlgExecutionUnit::union_all.
|
protected |
Definition at line 108 of file QueryFragmentDescriptor.cpp.
References allowed_outer_fragment_indices_, CHECK, CHECK_GE, CHECK_GT, checkDeviceMemoryUsage(), CPU, Data_Namespace::CPU_LEVEL, execution_kernels_per_device_, GPU, Data_Namespace::GPU_LEVEL, generate_TableFunctionsFactory_init::i, RelAlgExecutionUnit::input_descs, generate_TableFunctionsFactory_init::j, rowid_lookup_key_, selected_tables_fragments_, and RelAlgExecutionUnit::simple_quals.
Referenced by buildFragmentPerKernelMap(), and buildFragmentPerKernelMapForUnion().
|
protected |
Definition at line 281 of file QueryFragmentDescriptor.cpp.
References buildFragmentPerKernelForTable(), CHECK, RelAlgExecutionUnit::input_descs, outer_fragments_size_, selected_tables_fragments_, and table_is_temporary().
Referenced by buildFragmentKernelMap().
|
protected |
Definition at line 216 of file QueryFragmentDescriptor.cpp.
References gpu_enabled::accumulate(), buildFragmentPerKernelForTable(), CHECK, execution_kernels_per_device_, RelAlgExecutionUnit::input_descs, generate_TableFunctionsFactory_init::j, shared::printContainer(), selected_tables_fragments_, table_is_temporary(), and VLOG.
Referenced by buildFragmentKernelMap().
|
protected |
Definition at line 335 of file QueryFragmentDescriptor.cpp.
References allowed_outer_fragment_indices_, CHECK, CHECK_EQ, checkDeviceMemoryUsage(), execution_kernels_per_device_, GPU, Data_Namespace::GPU_LEVEL, RelAlgExecutionUnit::input_descs, generate_TableFunctionsFactory_init::j, outer_fragments_size_, rowid_lookup_key_, selected_tables_fragments_, and RelAlgExecutionUnit::simple_quals.
Referenced by buildFragmentKernelMap().
|
protected |
Definition at line 465 of file QueryFragmentDescriptor.cpp.
References available_gpu_mem_bytes_, CHECK_GE, g_cluster, Fragmenter_Namespace::FragmentInfo::getNumTuples(), gpu_input_mem_limit_percent_, LOG, tuple_count_per_device_, and logger::WARNING.
Referenced by buildFragmentPerKernelForTable(), and buildMultifragKernelMap().
|
static |
Definition at line 50 of file QueryFragmentDescriptor.cpp.
References CHECK_EQ, and RelAlgExecutionUnit::input_descs.
Referenced by ExecutionKernel::runImpl().
|
inline |
Definition at line 141 of file QueryFragmentDescriptor.h.
References execution_kernels_per_device_, and rowid_lookup_key_.
|
protected |
Definition at line 447 of file QueryFragmentDescriptor.cpp.
References anonymous_namespace{QueryFragmentDescriptor.cpp}::is_sample_query(), SortInfo::limit, SortInfo::offset, ExecutionKernelDescriptor::outer_tuple_count, and RelAlgExecutionUnit::sort_info.
Referenced by assignFragsToKernelDispatch().
|
protected |
Definition at line 146 of file QueryFragmentDescriptor.h.
Referenced by buildFragmentPerKernelForTable(), and buildMultifragKernelMap().
|
protected |
Definition at line 156 of file QueryFragmentDescriptor.h.
Referenced by checkDeviceMemoryUsage(), and QueryFragmentDescriptor().
|
protected |
Definition at line 152 of file QueryFragmentDescriptor.h.
Referenced by assignFragsToKernelDispatch(), assignFragsToMultiDispatch(), buildFragmentPerKernelForTable(), buildFragmentPerKernelMapForUnion(), buildMultifragKernelMap(), and shouldCheckWorkUnitWatchdog().
|
protected |
Definition at line 154 of file QueryFragmentDescriptor.h.
Referenced by checkDeviceMemoryUsage().
|
protected |
Definition at line 147 of file QueryFragmentDescriptor.h.
Referenced by buildFragmentPerKernelMap(), and buildMultifragKernelMap().
|
protected |
Definition at line 148 of file QueryFragmentDescriptor.h.
Referenced by assignFragsToKernelDispatch(), assignFragsToMultiDispatch(), buildFragmentPerKernelForTable(), buildMultifragKernelMap(), and shouldCheckWorkUnitWatchdog().
|
protected |
Definition at line 150 of file QueryFragmentDescriptor.h.
Referenced by buildFragmentPerKernelForTable(), buildFragmentPerKernelMap(), buildFragmentPerKernelMapForUnion(), buildMultifragKernelMap(), and QueryFragmentDescriptor().
|
protected |
Definition at line 155 of file QueryFragmentDescriptor.h.
Referenced by checkDeviceMemoryUsage().