OmniSciDB
a5dc49c757
|
#include <TieredCpuBufferMgr.h>
Public Member Functions | |
TieredCpuBufferMgr (const int device_id, const size_t total_size, CudaMgr_Namespace::CudaMgr *cuda_mgr, const size_t min_slab_size, const size_t max_slab_size, const size_t default_slab_size, const size_t page_size, const CpuTierSizeVector &cpu_tier_sizes, AbstractBufferMgr *parent_mgr=nullptr) | |
~TieredCpuBufferMgr () override | |
std::vector< std::pair < std::unique_ptr< Arena > , size_t > > & | getAllocators () |
MgrType | getMgrType () override |
std::string | getStringMgrType () override |
Arena * | getAllocatorForSlab (int32_t slab_num) const |
std::string | dump () const |
Public Member Functions inherited from Buffer_Namespace::CpuBufferMgr | |
CpuBufferMgr (const int device_id, const size_t max_buffer_pool_size, CudaMgr_Namespace::CudaMgr *cuda_mgr, const size_t min_slab_size, const size_t max_slab_size, const size_t default_slab_size, const size_t page_size, AbstractBufferMgr *parent_mgr=nullptr) | |
~CpuBufferMgr () override | |
MgrType | getMgrType () override |
std::string | getStringMgrType () override |
void | setAllocator (std::unique_ptr< DramArena > allocator) |
Public Member Functions inherited from Buffer_Namespace::BufferMgr | |
BufferMgr (const int device_id, const size_t max_buffer_size, const size_t min_slab_size, const size_t max_slab_size, const size_t default_slab_size, const size_t page_size, AbstractBufferMgr *parent_mgr=0) | |
Constructs a BufferMgr object that allocates memSize bytes. More... | |
~BufferMgr () override | |
Destructor. More... | |
std::string | printSlab (size_t slab_num) |
std::string | printSlabs () override |
void | clearSlabs () |
std::string | printMap () |
void | printSegs () |
std::string | printSeg (BufferList::iterator &seg_it) |
size_t | getInUseSize () override |
size_t | getMaxSize () override |
size_t | getAllocated () override |
size_t | getMaxBufferSize () |
size_t | getMaxSlabSize () |
size_t | getPageSize () |
bool | isAllocationCapped () override |
const std::vector< BufferList > & | getSlabSegments () |
AbstractBuffer * | createBuffer (const ChunkKey &key, const size_t page_size=0, const size_t initial_size=0) override |
Creates a chunk with the specified key and page size. More... | |
void | deleteBuffer (const ChunkKey &key, const bool purge=true) override |
Deletes the chunk with the specified key. More... | |
void | deleteBuffersWithPrefix (const ChunkKey &key_prefix, const bool purge=true) override |
AbstractBuffer * | getBuffer (const ChunkKey &key, const size_t num_bytes=0) override |
Returns the a pointer to the chunk with the specified key. More... | |
bool | isBufferOnDevice (const ChunkKey &key) override |
Puts the contents of d into the Buffer with ChunkKey key. More... | |
void | fetchBuffer (const ChunkKey &key, AbstractBuffer *dest_buffer, const size_t num_bytes=0) override |
AbstractBuffer * | putBuffer (const ChunkKey &key, AbstractBuffer *d, const size_t num_bytes=0) override |
void | checkpoint () override |
void | checkpoint (const int db_id, const int tb_id) override |
void | removeTableRelatedDS (const int db_id, const int table_id) override |
AbstractBuffer * | alloc (const size_t num_bytes=0) override |
client is responsible for deleting memory allocated for b->mem_ More... | |
void | free (AbstractBuffer *buffer) override |
size_t | size () |
Returns the total number of bytes allocated. More... | |
size_t | getNumChunks () override |
BufferList::iterator | reserveBuffer (BufferList::iterator &seg_it, const size_t num_bytes) |
void | getChunkMetadataVecForKeyPrefix (ChunkMetadataVector &chunk_metadata_vec, const ChunkKey &key_prefix) override |
Private Member Functions | |
void | addSlab (const size_t slab_size) override |
void | freeAllMem () override |
void | initializeMem () override |
Private Attributes | |
std::vector< std::pair < std::unique_ptr< Arena > , size_t > > | allocators_ |
std::map< int32_t, Arena * > | slab_to_allocator_map_ |
Additional Inherited Members | |
Protected Member Functions inherited from Buffer_Namespace::CpuBufferMgr | |
void | allocateBuffer (BufferList::iterator segment_iter, const size_t page_size, const size_t initial_size) override |
Protected Attributes inherited from Buffer_Namespace::CpuBufferMgr | |
CudaMgr_Namespace::CudaMgr * | cuda_mgr_ |
Protected Attributes inherited from Buffer_Namespace::BufferMgr | |
const size_t | max_buffer_pool_size_ |
const size_t | min_slab_size_ |
max number of bytes allocated for the buffer pool More... | |
const size_t | max_slab_size_ |
const size_t | default_slab_size_ |
const size_t | page_size_ |
std::vector< int8_t * > | slabs_ |
std::vector< BufferList > | slab_segments_ |
Definition at line 33 of file TieredCpuBufferMgr.h.
Buffer_Namespace::TieredCpuBufferMgr::TieredCpuBufferMgr | ( | const int | device_id, |
const size_t | total_size, | ||
CudaMgr_Namespace::CudaMgr * | cuda_mgr, | ||
const size_t | min_slab_size, | ||
const size_t | max_slab_size, | ||
const size_t | default_slab_size, | ||
const size_t | page_size, | ||
const CpuTierSizeVector & | cpu_tier_sizes, | ||
AbstractBufferMgr * | parent_mgr = nullptr |
||
) |
Definition at line 41 of file TieredCpuBufferMgr.cpp.
References allocators_, CHECK, Buffer_Namespace::BufferMgr::default_slab_size_, Data_Namespace::DRAM, kArenaBlockOverhead, Data_Namespace::numCpuTiers, and Data_Namespace::PMEM.
|
inlineoverride |
Definition at line 45 of file TieredCpuBufferMgr.h.
|
overrideprivatevirtual |
Reimplemented from Buffer_Namespace::CpuBufferMgr.
Definition at line 71 of file TieredCpuBufferMgr.cpp.
References allocators_, CHECK, Data_Namespace::DRAM, logger::INFO, LOG, Buffer_Namespace::BufferMgr::page_size_, Data_Namespace::PMEM, Buffer_Namespace::BufferMgr::slab_segments_, slab_to_allocator_map_, Buffer_Namespace::BufferMgr::slabs_, and anonymous_namespace{TieredCpuBufferMgr.cpp}::tier_to_string().
std::string Buffer_Namespace::TieredCpuBufferMgr::dump | ( | ) | const |
Definition at line 122 of file TieredCpuBufferMgr.cpp.
References allocators_.
|
overrideprivatevirtual |
Reimplemented from Buffer_Namespace::CpuBufferMgr.
Definition at line 108 of file TieredCpuBufferMgr.cpp.
References allocators_, CHECK, and initializeMem().
Arena * Buffer_Namespace::TieredCpuBufferMgr::getAllocatorForSlab | ( | int32_t | slab_num | ) | const |
Definition at line 67 of file TieredCpuBufferMgr.cpp.
References shared::get_from_map(), and slab_to_allocator_map_.
|
inline |
Definition at line 50 of file TieredCpuBufferMgr.h.
References allocators_.
|
inlineoverride |
Definition at line 54 of file TieredCpuBufferMgr.h.
|
inlineoverride |
Definition at line 55 of file TieredCpuBufferMgr.h.
|
overrideprivatevirtual |
Reimplemented from Buffer_Namespace::CpuBufferMgr.
Definition at line 114 of file TieredCpuBufferMgr.cpp.
References allocators_, Buffer_Namespace::BufferMgr::default_slab_size_, Data_Namespace::DRAM, kArenaBlockOverhead, Data_Namespace::PMEM, and slab_to_allocator_map_.
Referenced by freeAllMem().
|
private |
Definition at line 67 of file TieredCpuBufferMgr.h.
Referenced by addSlab(), dump(), freeAllMem(), getAllocators(), initializeMem(), and TieredCpuBufferMgr().
|
private |
Definition at line 70 of file TieredCpuBufferMgr.h.
Referenced by addSlab(), getAllocatorForSlab(), and initializeMem().