OmniSciDB
a5dc49c757
|
#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< shared::TableKey, 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< shared::TableKey, 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 68 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 111 of file QueryFragmentDescriptor.h.
References CHECK, execution_kernels_per_device_, 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 94 of file QueryFragmentDescriptor.h.
References CHECK_EQ, execution_kernels_per_device_, 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 63 of file QueryFragmentDescriptor.cpp.
References buildFragmentPerKernelMap(), buildFragmentPerKernelMapForUnion(), buildMultifragKernelMap(), RelAlgExecutionUnit::input_descs, and RelAlgExecutionUnit::union_all.
|
protected |
Definition at line 107 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, RelAlgExecutionUnit::input_descs, rowid_lookup_key_, selected_tables_fragments_, and RelAlgExecutionUnit::simple_quals.
Referenced by buildFragmentPerKernelMap(), and buildFragmentPerKernelMapForUnion().
|
protected |
Definition at line 282 of file QueryFragmentDescriptor.cpp.
References buildFragmentPerKernelForTable(), CHECK, CHECK_GT, Catalog_Namespace::SysCatalog::getCatalog(), RelAlgExecutionUnit::input_descs, Catalog_Namespace::SysCatalog::instance(), outer_fragments_size_, selected_tables_fragments_, and table_is_temporary().
Referenced by buildFragmentKernelMap().
|
protected |
Definition at line 218 of file QueryFragmentDescriptor.cpp.
References gpu_enabled::accumulate(), buildFragmentPerKernelForTable(), CHECK, CHECK_GT, execution_kernels_per_device_, Catalog_Namespace::get_metadata_for_table(), RelAlgExecutionUnit::input_descs, shared::printContainer(), selected_tables_fragments_, table_is_temporary(), and VLOG.
Referenced by buildFragmentKernelMap().
|
protected |
Definition at line 349 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, outer_fragments_size_, rowid_lookup_key_, selected_tables_fragments_, and RelAlgExecutionUnit::simple_quals.
Referenced by buildFragmentKernelMap().
|
protected |
Definition at line 479 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 49 of file QueryFragmentDescriptor.cpp.
References CHECK_EQ, and RelAlgExecutionUnit::input_descs.
Referenced by ExecutionKernel::runImpl().
|
inline |
Definition at line 142 of file QueryFragmentDescriptor.h.
References execution_kernels_per_device_, and rowid_lookup_key_.
|
protected |
Definition at line 461 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 147 of file QueryFragmentDescriptor.h.
Referenced by buildFragmentPerKernelForTable(), and buildMultifragKernelMap().
|
protected |
Definition at line 157 of file QueryFragmentDescriptor.h.
Referenced by checkDeviceMemoryUsage(), and QueryFragmentDescriptor().
|
protected |
Definition at line 153 of file QueryFragmentDescriptor.h.
Referenced by assignFragsToKernelDispatch(), assignFragsToMultiDispatch(), buildFragmentPerKernelForTable(), buildFragmentPerKernelMapForUnion(), buildMultifragKernelMap(), and shouldCheckWorkUnitWatchdog().
|
protected |
Definition at line 155 of file QueryFragmentDescriptor.h.
Referenced by checkDeviceMemoryUsage().
|
protected |
Definition at line 148 of file QueryFragmentDescriptor.h.
Referenced by buildFragmentPerKernelMap(), and buildMultifragKernelMap().
|
protected |
Definition at line 149 of file QueryFragmentDescriptor.h.
Referenced by assignFragsToKernelDispatch(), assignFragsToMultiDispatch(), buildFragmentPerKernelForTable(), buildMultifragKernelMap(), and shouldCheckWorkUnitWatchdog().
|
protected |
Definition at line 151 of file QueryFragmentDescriptor.h.
Referenced by buildFragmentPerKernelForTable(), buildFragmentPerKernelMap(), buildFragmentPerKernelMapForUnion(), buildMultifragKernelMap(), and QueryFragmentDescriptor().
|
protected |
Definition at line 156 of file QueryFragmentDescriptor.h.
Referenced by checkDeviceMemoryUsage().