diff --git a/dbcon/joblist/tupleannexstep.cpp b/dbcon/joblist/tupleannexstep.cpp index 62037cc75..fb340e23b 100644 --- a/dbcon/joblist/tupleannexstep.cpp +++ b/dbcon/joblist/tupleannexstep.cpp @@ -85,8 +85,9 @@ struct TAEq // TODO: Generalize these and put them back in utils/common/hasher.h // using TNSDistinctMap_t = std::unordered_set >; -using TNSDistinctMap_t = - std::unordered_set >; +using TNSDistinctMap_t = std::unordered_set; +// using TNSDistinctMap_t = +// std::unordered_set >; }; // namespace inline uint64_t TAHasher::operator()(const Row::Pointer& p) const @@ -462,8 +463,10 @@ void TupleAnnexStep::executeNoOrderByWithDistinct() // auto alloc = fRm->getAllocator(); // std::unique_ptr distinctMap(new TNSDistinctMap_t(10, TAHasher(this), TAEq(this), // alloc)); - std::unique_ptr distinctMap( - new TNSDistinctMap_t(10, TAHasher(this), TAEq(this), STLPoolAllocator(fRm))); + // WIP + // std::unique_ptr distinctMap( + // new TNSDistinctMap_t(10, TAHasher(this), TAEq(this), STLPoolAllocator(fRm))); + std::unique_ptr distinctMap(new TNSDistinctMap_t(10, TAHasher(this), TAEq(this))); rgDataOut.reinit(fRowGroupOut); fRowGroupOut.setData(&rgDataOut); @@ -724,8 +727,9 @@ void TupleAnnexStep::finalizeParallelOrderByDistinct() ordering::SortingPQ finalPQ(rowgroup::rgCommonSize, fRm->getAllocator()); // ordering::SortingPQ finalPQ(rowgroup::rgCommonSize); // auto allocDistinct = fRm->getAllocator(); - std::unique_ptr distinctMap( - new TNSDistinctMap_t(10, TAHasher(this), TAEq(this), STLPoolAllocator(fRm))); + // std::unique_ptr distinctMap( + // new TNSDistinctMap_t(10, TAHasher(this), TAEq(this), STLPoolAllocator(fRm))); + std::unique_ptr distinctMap(new TNSDistinctMap_t(10, TAHasher(this), TAEq(this))); fRowGroupIn.initRow(&row1); fRowGroupIn.initRow(&row2); diff --git a/primitives/primproc/batchprimitiveprocessor.cpp b/primitives/primproc/batchprimitiveprocessor.cpp index f934de6de..b5a18bee4 100644 --- a/primitives/primproc/batchprimitiveprocessor.cpp +++ b/primitives/primproc/batchprimitiveprocessor.cpp @@ -364,17 +364,17 @@ void BatchPrimitiveProcessor::initBPP(ByteStream& bs) if (!typelessJoin[i]) { - // auto allocator = exemgr::globServiceExeMgr->getRm().getAllocator(); + auto allocator = exemgr::globServiceExeMgr->getRm().getAllocator(); bs >> joinNullValues[i]; bs >> largeSideKeyColumns[i]; for (uint j = 0; j < processorThreads; ++j) - // tJoiners[i][j].reset(new TJoiner(10, TupleJoiner::hasher(), allocator)); - tJoiners[i][j].reset(new TJoiner(10, TupleJoiner::hasher(), std::equal_to(), - utils::STLPoolAllocator(resourceManager))); + tJoiners[i][j].reset(new TJoiner(10, TupleJoiner::hasher(), std::equal_to(), allocator)); + // tJoiners[i][j].reset(new TJoiner(10, TupleJoiner::hasher(), std::equal_to(), + // utils::STLPoolAllocator(resourceManager))); } else { - // auto allocator = exemgr::globServiceExeMgr->getRm().getAllocator(); + auto allocator = exemgr::globServiceExeMgr->getRm().getAllocator(); deserializeVector(bs, tlLargeSideKeyColumns[i]); bs >> tlSmallSideKeyLengths[i]; @@ -397,9 +397,9 @@ void BatchPrimitiveProcessor::initBPP(ByteStream& bs) mSmallSideKeyColumnsPtr, mSmallSideRGPtr); auto tlComparator = TupleJoiner::TypelessDataComparator(&outputRG, &tlLargeSideKeyColumns[i], mSmallSideKeyColumnsPtr, mSmallSideRGPtr); - // tlJoiners[i][j].reset(new TLJoiner(10, tlHasher, tlComparator, allocator)); - tlJoiners[i][j].reset(new TLJoiner(10, tlHasher, tlComparator, - utils::STLPoolAllocator(resourceManager))); + tlJoiners[i][j].reset(new TLJoiner(10, tlHasher, tlComparator, allocator)); + // tlJoiners[i][j].reset(new TLJoiner(10, tlHasher, tlComparator, + // utils::STLPoolAllocator(resourceManager))); } } } diff --git a/primitives/primproc/batchprimitiveprocessor.h b/primitives/primproc/batchprimitiveprocessor.h index ee817fdb5..cc847d82b 100644 --- a/primitives/primproc/batchprimitiveprocessor.h +++ b/primitives/primproc/batchprimitiveprocessor.h @@ -308,23 +308,23 @@ class BatchPrimitiveProcessor bool hasRowGroup; /* Rowgroups + join */ - // using TJoiner = - // std::unordered_multimap, - // allocators::CountingAllocator>>; + using TJoiner = + std::unordered_multimap, + allocators::CountingAllocator>>; - using TJoiner = std::tr1::unordered_multimap, - utils::STLPoolAllocator>>; + // using TJoiner = std::tr1::unordered_multimap, + // utils::STLPoolAllocator>>; - // using TLJoiner = - // std::unordered_multimap>>; + using TLJoiner = + std::unordered_multimap>>; - using TLJoiner = std::tr1::unordered_multimap< - joiner::TypelessData, uint32_t, joiner::TupleJoiner::TypelessDataHasher, - joiner::TupleJoiner::TypelessDataComparator, - utils::STLPoolAllocator>>; + // using TLJoiner = std::tr1::unordered_multimap< + // joiner::TypelessData, uint32_t, joiner::TupleJoiner::TypelessDataHasher, + // joiner::TupleJoiner::TypelessDataComparator, + // utils::STLPoolAllocator>>; bool generateJoinedRowGroup(rowgroup::Row& baseRow, const uint32_t depth = 0); /* generateJoinedRowGroup helper fcns & vars */ diff --git a/utils/common/poolallocator.cpp b/utils/common/poolallocator.cpp index 428943d13..4dbf99def 100644 --- a/utils/common/poolallocator.cpp +++ b/utils/common/poolallocator.cpp @@ -63,13 +63,13 @@ void PoolAllocator::newBlock() { if (alloc) { - std::cout << "PoolAllocator new block with counting alloc" << std::endl; + // std::cout << "PoolAllocator new block with counting alloc" << std::endl; mem.emplace_back(boost::allocate_shared(*alloc, allocSize)); } else { - std::cout << "PoolAllocator new block w/o counting alloc" << std::endl; + // std::cout << "PoolAllocator new block w/o counting alloc" << std::endl; mem.emplace_back(boost::make_shared(allocSize)); } nextAlloc = mem.back().get(); @@ -81,17 +81,17 @@ void PoolAllocator::newBlock() void* PoolAllocator::allocOOB(uint64_t size) { OOBMemInfo memInfo; - std::cout << "PoolAllocator allocOOB" << std::endl; + // std::cout << "PoolAllocator allocOOB" << std::endl; memUsage += size; if (alloc) { - std::cout << "PoolAllocator allocOOB with counting alloc" << std::endl; + // std::cout << "PoolAllocator allocOOB with counting alloc" << std::endl; memInfo.mem = boost::allocate_shared(*alloc, size); } else { - std::cout << "PoolAllocator allocOOB w/o counting alloc" << std::endl; + // std::cout << "PoolAllocator allocOOB w/o counting alloc" << std::endl; memInfo.mem = boost::make_shared(size); } memInfo.size = size; diff --git a/utils/common/stlpoolallocator.h b/utils/common/stlpoolallocator.h index 3d511117d..2ae279272 100644 --- a/utils/common/stlpoolallocator.h +++ b/utils/common/stlpoolallocator.h @@ -101,13 +101,13 @@ STLPoolAllocator::STLPoolAllocator(joblist::ResourceManager* rm) { if (rm) { - std::cout << "STLPoolAllocator with RM " << std::endl; - auto alloc = rm->getAllocator(); + // std::cout << "STLPoolAllocator with RM " << std::endl; + auto alloc = rm->getAllocator(1024); pa.reset(new PoolAllocator(alloc, DEFAULT_SIZE)); } else { - std::cout << "STLPoolAllocator w/o RM " << std::endl; + // std::cout << "STLPoolAllocator w/o RM " << std::endl; pa.reset(new PoolAllocator(DEFAULT_SIZE)); } } diff --git a/utils/joiner/tuplejoiner.cpp b/utils/joiner/tuplejoiner.cpp index 12644abd6..142cc915c 100644 --- a/utils/joiner/tuplejoiner.cpp +++ b/utils/joiner/tuplejoiner.cpp @@ -45,8 +45,10 @@ std::unique_ptr makeHashMap(size_t bucketCount, ResourceManager* reso { // auto alloc = resourceManager->getAllocator(); // return std::unique_ptr(new T(bucketCount, TupleJoiner::hasher(), typename T::key_equal(), alloc)); + // std::cout << " makeHashMap " << std::endl; return std::unique_ptr(new HashTable(bucketCount, TupleJoiner::hasher(), typename HashTable::key_equal(), + // resourceManager->getAllocator())); utils::STLPoolAllocator(resourceManager))); } diff --git a/utils/joiner/tuplejoiner.h b/utils/joiner/tuplejoiner.h index 72ce17770..f29e7de86 100644 --- a/utils/joiner/tuplejoiner.h +++ b/utils/joiner/tuplejoiner.h @@ -497,6 +497,9 @@ class TupleJoiner template using HashMapTemplate = std::unordered_multimap, utils::STLPoolAllocator>>; + // template + // using HashMapTemplate = std::unordered_multimap, + // allocators::CountingAllocator>>; using hash_t = HashMapTemplate; using sthash_t = HashMapTemplate; using typelesshash_t = HashMapTemplate; diff --git a/utils/windowfunction/idborderby.cpp b/utils/windowfunction/idborderby.cpp index b1b9849a4..fd8713dbd 100644 --- a/utils/windowfunction/idborderby.cpp +++ b/utils/windowfunction/idborderby.cpp @@ -776,11 +776,12 @@ void IdbOrderBy::initialize(const RowGroup& rg) // These two blocks contain structs with memory accounting. fOrderByQueue.reset(new SortingPQ(rowgroup::rgCommonSize, fRm->getAllocator())); - if (fDistinct) - { - fDistinctMap.reset(new DistinctMap_t(10, Hasher(this, getKeyLength()), Eq(this, getKeyLength()), - utils::STLPoolAllocator(fRm))); - } + // WIP + // if (fDistinct) + // { + // fDistinctMap.reset(new DistinctMap_t(10, Hasher(this, getKeyLength()), Eq(this, getKeyLength()), + // utils::STLPoolAllocator(fRm))); + // } } bool IdbOrderBy::getData(RGData& data)