Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
logger.hpp File Reference
#include <thrill/mem/allocator.hpp>
#include <thrill/mem/pool.hpp>
#include <tlx/meta/call_foreach_tuple.hpp>
#include <array>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
+ Include dependency graph for logger.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Logger
 LOG and sLOG for development and debugging. More...
 
class  LoggerVoidify
 
class  SpacingLogger
 A logging class which outputs spaces between elements pushed via operator<<. More...
 
struct  LogStreamTuplePrinter< Tuple, N >
 
struct  LogStreamTuplePrinter< Tuple, 0 >
 
struct  LogStreamTuplePrinter< Tuple, 1 >
 

Namespaces

 thrill
 
 thrill::common
 Contains many common tools and helpers shared by higher layers. See common.
 
 thrill::mem
 

Macros

#define LOG   LOGC(debug)
 Default logging method: output if the local debug variable is true. More...
 
#define LOG0   LOGC(false)
 Override default output: never or always output log. More...
 
#define LOG1   LOGC(true)
 
#define LOGC(cond)
 Explicitly specify the condition for logging. More...
 
#define sLOG   sLOGC(debug)
 Default logging method: output if the local debug variable is true. More...
 
#define sLOG0   sLOGC(false)
 Override default output: never or always output log. More...
 
#define sLOG1   sLOGC(true)
 
#define sLOGC(cond)
 Explicitly specify the condition for logging. More...
 
#define THRILL_COMMON_LOGGER_HEADER
 

Typedefs

using log_stream = safe_ostringstream
 

Functions

std::string GetNameForThisThread ()
 Returns the name of the current thread or 'unknown [id]'. More...
 
void NameThisThread (const mem::by_string &name)
 Defines a name for the current thread, only if no name was set previously. More...
 
template<typename A , typename B >
log_stream & operator<< (log_stream &os, const std::pair< A, B > &p)
 
template<typename... Args>
log_stream & operator<< (log_stream &os, const std::tuple< Args...> &t)
 
template<typename T , size_t N>
log_stream & operator<< (log_stream &os, const std::array< T, N > &data)
 Logging helper to print arrays as [a1,a2,a3,...]. More...
 
template<typename T >
log_stream & operator<< (log_stream &os, const std::vector< T > &data)
 Logging helper to print vectors as [a1,a2,a3,...]. More...
 

Macro Definition Documentation

#define LOG   LOGC(debug)

Default logging method: output if the local debug variable is true.

Definition at line 172 of file logger.hpp.

Referenced by Socket::accept(), Dispatcher::AddAsyncRequest(), DiskAllocator::AddFreeRegion(), AlignedAllocator< Type, BaseAllocator, Alignment >::allocate_bytes(), FlowControlChannel::AllReduce(), Group::AllReduceMaximumInt(), Group::AllReduceMaximumLong(), Group::AllReduceMaximumLongLong(), Group::AllReduceMaximumUnsignedInt(), Group::AllReduceMaximumUnsignedLong(), Group::AllReduceMaximumUnsignedLongLong(), Group::AllReduceMinimumInt(), Group::AllReduceMinimumLong(), Group::AllReduceMinimumLongLong(), Group::AllReduceMinimumUnsignedInt(), Group::AllReduceMinimumUnsignedLong(), Group::AllReduceMinimumUnsignedLongLong(), Group::AllReducePlusInt(), Group::AllReducePlusLong(), Group::AllReducePlusLongLong(), Group::AllReducePlusUnsignedInt(), Group::AllReducePlusUnsignedLong(), Group::AllReducePlusUnsignedLongLong(), BlockQueue::AppendBlock(), MixBlockQueue::AppendBlock(), StreamSink::AppendPinnedBlock(), Dispatcher::AsyncRead(), FlowControlChannel::Barrier(), BernoulliSampleNode< ValueType >::BernoulliSampleNode(), Socket::bind(), BlockQueueSink::BlockQueueSink(), FlowControlChannel::Broadcast(), Group::BroadcastInt(), Group::BroadcastLong(), Group::BroadcastLongLong(), Group::BroadcastUnsignedInt(), Group::BroadcastUnsignedLong(), Group::BroadcastUnsignedLongLong(), LinuxaioRequest::cancel(), Dispatcher::Cancel(), SelectDispatcher::Cancel(), Request::cancel(), LinuxaioRequest::cancel_aio(), MixStreamData::Close(), StreamSink::Close(), MixBlockQueue::Close(), CatStreamData::Close(), Socket::close(), LinuxaioRequest::completed(), Request::completed(), Socket::connect(), Group::ConstructLoopbackMesh(), Socket::Create(), DiskAllocator::DeleteBlock(), MemoryFile::discard(), Dispatcher::Dispatch(), SelectDispatcher::DispatchOne(), Dispatcher::DispatchOne(), ZipNode< ValueType, ZipFunction, Pad, UnequalCheck, NoRebalance, kNumInputs >::DoScatter(), ZipWindowNode< ValueType, ZipFunction_, Pad_, UnequalCheck, UseStdArray, kNumInputs_ >::DoScatter(), ConcatNode< ValueType >::Execute(), Group::ExPrefixSumPlusInt(), Group::ExPrefixSumPlusLong(), Group::ExPrefixSumPlusLongLong(), Group::ExPrefixSumPlusUnsignedInt(), Group::ExPrefixSumPlusUnsignedLong(), Group::ExPrefixSumPlusUnsignedLongLong(), FlowControlChannel::ExPrefixSumTotal(), FileBlockSink::FileBlockSink(), SortNode< ValueType, CompareFunction, SortAlgorithm >::FindAndSendSplitters(), thrill::api::FindStages(), ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::Flush(), LocationDetection< thrill::api::JoinNode::HashCount >::Flush(), ReduceOldProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::FlushPartitionEmit(), ReduceProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::FlushPartitionEmit(), ReduceBucketHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig, IndexFunction, KeyEqualFunction >::FlushPartitionEmit(), File::GetIndexOf(), Socket::GetLocalAddress(), Socket::GetPeerAddress(), Socket::getsockopt(), MixStreamData::GetWriters(), CatStreamData::GetWriters(), ReadLinesNode::InputLineIteratorCompressed::HasNext(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), ReadLinesNode::InputLineIteratorCompressed::InputLineIteratorCompressed(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert(), ReduceProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::Insert(), Multiplexer::IntReleaseCatStream(), Multiplexer::IntReleaseMixStream(), Dispatcher::IRecv(), Dispatcher::ISend(), LinuxaioRequest::LinuxaioRequest(), Socket::listen(), GroupToIndexNode< ValueType, KeyExtractor, GroupFunction >::MainOp(), MergeNode< ValueType, Comparator, kNumInputs >::MainOp(), DiskAllocator::NewBlocks(), ReadLinesNode::InputLineIteratorUncompressed::Next(), ReadLinesNode::InputLineIteratorCompressed::Next(), ConsumeBlockQueueSource::NextBlock(), CacheBlockQueueSource::NextBlock(), ReadBinaryNode< ValueType >::VfsFileBlockSource::NextBlock(), Multiplexer::OnMultiplexerHeader(), CatStreamData::OnStreamBlock(), BernoulliSampleNode< ValueType >::operator()(), examples::select::PickPivots(), PinnedBlock::PinnedBlock(), MixBlockQueue::Pop(), LinuxaioRequest::post(), FlowControlChannel::Predecessor(), FlowControlChannel::PrefixSum(), Group::PrefixSumPlusInt(), Group::PrefixSumPlusLong(), Group::PrefixSumPlusLongLong(), Group::PrefixSumPlusUnsignedInt(), Group::PrefixSumPlusUnsignedLong(), Group::PrefixSumPlusUnsignedLongLong(), MixBlockQueueReader::PullBlock(), Dispatcher::PumpRecvQueue(), Dispatcher::PumpSendQueue(), ConcatNode< ValueType >::PushData(), TypedBlock< RawSize, Type, NRef, MetaInfoType >::read(), ReadBinaryNode< ValueType >::ReadBinaryNode(), ReadLinesNode::InputLineIterator::ReadBlock(), Socket::recv(), Socket::recv_one(), Socket::recvfrom(), FlowControlChannel::Reduce(), Request::Request(), DIABase::RunScope(), RunSelect(), examples::select::Select(), MergeNode< ValueType, Comparator, kNumInputs >::SelectPivots(), Socket::send(), Socket::send_one(), Socket::sendto(), ServingRequest::serve(), Socket::SetKeepAlive(), Socket::SetNoDelay(), Socket::SetNonBlocking(), Socket::SetRcvBuf(), Socket::SetReuseAddr(), Socket::SetSndBuf(), Socket::setsockopt(), SortNode< ValueType, CompareFunction, SortAlgorithm >::SortAndWriteToFile(), ReduceOldProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::SpillPartition(), ReduceProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::SpillPartition(), UnionNode< ValueType >::StartPreOp(), JoinNode< ValueType, FirstDIA, SecondDIA, KeyExtractor1, KeyExtractor2, JoinFunction, HashFunction, UseLocationDetection >::StartPreOp(), UnionNode< ValueType >::StopPreOp(), JoinNode< ValueType, FirstDIA, SecondDIA, KeyExtractor1, KeyExtractor2, JoinFunction, HashFunction, UseLocationDetection >::StopPreOp(), Connection::SyncRecv(), Connection::SyncSend(), Connection::SyncSendRecv(), TypedBlock< RawSize, Type, NRef, MetaInfoType >::TypedBlock(), Request::wait(), DispatcherThread::Work(), RequestQueueImplQwQr::worker(), TypedBlock< RawSize, Type, NRef, MetaInfoType >::write(), BlockManager::~BlockManager(), BlockQueueSink::~BlockQueueSink(), CatStreamData::~CatStreamData(), Dispatcher::~Dispatcher(), FileBlockSink::~FileBlockSink(), MixStreamData::~MixStreamData(), PinnedBlock::~PinnedBlock(), and Request::~Request().

#define LOG1   LOGC(true)

Definition at line 176 of file logger.hpp.

Referenced by UfsFileBase::_after_open(), RequestQueueImpl1Q::AddRequest(), RequestQueueImplQwQr::AddRequest(), LinuxaioQueue::AddRequest(), AlignedAllocator< Type, BaseAllocator, Alignment >::allocate_bytes(), RequestQueueImpl1Q::CancelRequest(), RequestQueueImplQwQr::CancelRequest(), LinuxaioQueue::CancelRequest(), Request::check_alignment(), Request::check_nref_failed(), examples::suffix_sorting::CheckSA(), Multiplexer::Close(), UfsFileBase::close_remove(), CountTrianglesGenerated(), Socket::CreatePair(), thrill::common::CreateThread(), DiskAllocator::DeallocationError(), Dispatcher::DispatchOne(), DiskAllocator::Dump(), SelectDispatcher::Interrupt(), JoinNode< ValueType, FirstDIA, SecondDIA, KeyExtractor1, KeyExtractor2, JoinFunction, HashFunction, UseLocationDetection >::JoinAllElements(), JoinTPCH4(), Context::Launch(), LinuxaioQueue::LinuxaioQueue(), main(), MergeNode< ValueType, Comparator, kNumInputs >::MainOp(), ZipfDistribution::make_dist(), DiskAllocator::NewBlocks(), thrill::io::open_file_impl(), AsyncWriteBuffer::operator()(), AsyncWriteBlock::operator()(), StochasticGradientDescent< Vector >::optimize(), thrill::data::OurNewHandler(), Percentiles(), examples::suffix_sorting::PrefixDoublingDiscarding(), examples::suffix_sorting::PrefixDoublingPack(), examples::suffix_sorting::PrefixDoublingSorting(), examples::suffix_sorting::PrefixDoublingWindow(), examples::suffix_sorting::PrefixQuadrupling(), examples::suffix_sorting::PrefixQuadruplingDiscarding(), Context::PrintCollectiveMeanStdev(), MergeNode< ValueType, Comparator, kNumInputs >::Stats::PrintToSQLPlotTool(), Buffer::Resize(), RunHashWordCount(), RunJoinPageRankEdgePerLine(), RunKMeansFile(), RunKMeansGenerated(), RunPageRankEdgePerLine(), RunPageRankGenerated(), RunPageRankJoinGenerated(), RunStochasticGradFile(), RunStochasticGradGenerated(), RunWordCount(), SelectDispatcher::SelectDispatcher(), WincallFile::serve(), thrill::common::SetCpuAffinity(), thrill::vfs::SysOpenReadStream(), thrill::vfs::SysOpenWriteStream(), UfsFileBase::UfsFileBase(), UfsFileBase::unlink(), WfsFileBase::WfsFileBase(), and Dispatcher::~Dispatcher().

#define sLOG   sLOGC(debug)

Default logging method: output if the local debug variable is true.

Definition at line 184 of file logger.hpp.

Referenced by ReservoirSamplingGrow< SampleIndexPair >::add(), BlockWriter< BlockSink >::AllocateBlock(), Group::BroadcastBinomialTree(), CatStreamData::Close(), ReducePrePhaseEmitter< TableItem, VolatileKey, BlockWriter >::CloseAll(), Group::ConstructLocalRealTCPMesh(), examples::suffix_sorting::ConstructWaveletTree(), ConstructWaveletTree(), Dispatcher::Dispatch(), Dispatcher::DispatchOne(), Sampling< RNG >::do_sample(), OverlapWindowNode< ValueType, Input, WindowFunction, PartialWindowFunction >::Execute(), ConcatNode< ValueType >::Execute(), DisjointWindowNode< ValueType, Input, WindowFunction, PartialWindowFunction >::Execute(), thrill::vfs::FillFilePattern(), DuplicateDetection::FindNonDuplicates(), ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::Flush(), BlockWriter< BlockSink >::Flush(), BlockQueue::GetBlockSource(), BlockReader< CatBlockSource >::GetItemBatch(), File::GetReaderAt(), ReduceProbingHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >::GrowPartition(), Sampling< RNG >::hash_sample(), ReduceBucketHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig, IndexFunction, KeyEqualFunction >::Initialize(), ReadLinesNode::InputLineIteratorCompressed::InputLineIteratorCompressed(), ReadLinesNode::InputLineIteratorUncompressed::InputLineIteratorUncompressed(), Multiplexer::IntReleaseCatStream(), Multiplexer::IntReleaseMixStream(), LocationDetection< thrill::api::JoinNode::HashCount >::LocationDetection(), CatStreamData::loopback_queue(), ZipNode< ValueType, ZipFunction, Pad, UnequalCheck, NoRebalance, kNumInputs >::MainOp(), ZipWindowNode< ValueType, ZipFunction_, Pad_, UnequalCheck, UseStdArray, kNumInputs_ >::MainOp(), SortNode< ValueType, CompareFunction, SortAlgorithm >::MainOp(), Multiplexer::OnCatStreamBlock(), Multiplexer::OnMixStreamBlock(), Multiplexer::OnMultiplexerHeader(), MixStreamData::OnStreamBlock(), CatStreamData::OnStreamBlock(), MixStreamData::OnStreamBlockOrdered(), CatStreamData::OnStreamBlockOrdered(), WriteBinaryNode< ValueType >::OpenNextFile(), ByteBlock::Deleter::operator()(), Group::PrefixSumDoubling(), Group::PrefixSumHypercube(), MergeNode< ValueType, Comparator, kNumInputs >::PushData(), OverlapWindowNode< ValueType, Input, WindowFunction, PartialWindowFunction >::PushData(), DisjointWindowNode< ValueType, Input, WindowFunction, PartialWindowFunction >::PushData(), BlockWriter< BlockSink >::PutSafe(), ReadBinaryNode< ValueType >::ReadBinaryNode(), ReadLinesNode::ReadLinesNode(), Group::Reduce(), ReducePrePhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, VolatileKey, BlockWriter, ReduceConfig_, IndexFunction, KeyEqualFunction, HashFunction, false >::ReducePrePhase(), Group::Send(), ReduceBucketHashTable< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig, IndexFunction, KeyEqualFunction >::SpillPartition(), thrill::vfs::SysOpenReadStream(), thrill::vfs::SysOpenWriteStream(), and SocketAddress::ToStringHost().

#define sLOG0   sLOGC(false)

Override default output: never or always output log.

Definition at line 187 of file logger.hpp.

Referenced by ReservoirSamplingGrow< SampleIndexPair >::add(), Dispatcher::DispatchOne(), BlockReader< CatBlockSource >::NextBlock(), and thrill::common::qsort_three_pivots().

#define sLOGC (   cond)
Value:
!(cond) ? (void)0 : \
::thrill::common::LoggerVoidify() & ::thrill::common::SpacingLogger()
A logging class which outputs spaces between elements pushed via operator<<.
Definition: logger.hpp:132

Explicitly specify the condition for logging.

Definition at line 179 of file logger.hpp.

Referenced by BlockPool::DestroyBlock(), BlockPool::OnReadComplete(), BlockPool::OnWriteComplete(), and FlowControlChannel::~FlowControlChannel().

#define THRILL_COMMON_LOGGER_HEADER

Definition at line 15 of file logger.hpp.