STXXL  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
verbose.h File Reference
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
#include <stxxl/bits/unused.h>

Go to the source code of this file.

Namespaces

 stxxl
 STXXL library namespace
 

Macros

#define _STXXL_NOT_VERBOSE   do { } while (false)
 
#define _STXXL_PRINT(label, message, flags)
 
#define _STXXL_PRINT_FLAGS_DEFAULT   (_STXXL_PRNT_COUT | _STXXL_PRNT_LOG)
 
#define _STXXL_PRINT_FLAGS_ERROR   (_STXXL_PRNT_CERR | _STXXL_PRNT_ERRLOG)
 
#define _STXXL_PRINT_FLAGS_VERBOSE   (_STXXL_PRINT_FLAGS_DEFAULT | _STXXL_PRNT_TIMESTAMP | _STXXL_PRNT_THREAD_ID)
 
#define _STXXL_PRNT_ADDNEWLINE   (1 << 16)
 
#define _STXXL_PRNT_CERR   (1 << 1)
 
#define _STXXL_PRNT_COUT   (1 << 0)
 
#define _STXXL_PRNT_ERRLOG   (1 << 3)
 
#define _STXXL_PRNT_LOG   (1 << 2)
 
#define _STXXL_PRNT_THREAD_ID   (1 << 18)
 
#define _STXXL_PRNT_TIMESTAMP   (1 << 17)
 
#define STXXL_ASSERT(condition)
 
#define STXXL_CHECK(condition)
 
#define STXXL_CHECK2(condition, text)
 
#define STXXL_CHECK_THROW(code, exception_type)
 
#define STXXL_ERRMSG(x)   _STXXL_PRINT("STXXL-ERRMSG", x, _STXXL_PRINT_FLAGS_ERROR)
 
#define STXXL_MSG(x)   _STXXL_PRINT("STXXL-MSG", x, _STXXL_PRINT_FLAGS_DEFAULT)
 
#define STXXL_VERBOSE(x)   STXXL_VERBOSE1(x)
 
#define STXXL_VERBOSE0(x)   _STXXL_NOT_VERBOSE
 
#define STXXL_VERBOSE1(x)   _STXXL_NOT_VERBOSE
 
#define STXXL_VERBOSE2(x)   _STXXL_NOT_VERBOSE
 
#define STXXL_VERBOSE3(x)   _STXXL_NOT_VERBOSE
 
#define STXXL_VERBOSE_LEVEL   -1
 

Functions

void stxxl::print_msg (const char *label, const std::string &msg, unsigned flags)
 

Macro Definition Documentation

#define _STXXL_NOT_VERBOSE   do { } while (false)

Definition at line 52 of file verbose.h.

#define _STXXL_PRINT (   label,
  message,
  flags 
)
Value:
do { \
std::ostringstream str_; \
str_ << message; \
stxxl::print_msg(label, str_.str(), flags | _STXXL_PRNT_ADDNEWLINE); \
} while (false)
#define _STXXL_PRNT_ADDNEWLINE
Definition: verbose.h:29
void print_msg(const char *label, const std::string &msg, unsigned flags)
Definition: verbose.cpp:35

Definition at line 45 of file verbose.h.

#define _STXXL_PRINT_FLAGS_DEFAULT   (_STXXL_PRNT_COUT | _STXXL_PRNT_LOG)

Definition at line 33 of file verbose.h.

#define _STXXL_PRINT_FLAGS_ERROR   (_STXXL_PRNT_CERR | _STXXL_PRNT_ERRLOG)

Definition at line 34 of file verbose.h.

#define _STXXL_PRINT_FLAGS_VERBOSE   (_STXXL_PRINT_FLAGS_DEFAULT | _STXXL_PRNT_TIMESTAMP | _STXXL_PRNT_THREAD_ID)

Definition at line 35 of file verbose.h.

#define _STXXL_PRNT_ADDNEWLINE   (1 << 16)

Definition at line 29 of file verbose.h.

Referenced by stxxl::print_msg().

#define _STXXL_PRNT_CERR   (1 << 1)

Definition at line 26 of file verbose.h.

Referenced by stxxl::print_msg().

#define _STXXL_PRNT_COUT   (1 << 0)

Definition at line 25 of file verbose.h.

Referenced by stxxl::print_msg().

#define _STXXL_PRNT_ERRLOG   (1 << 3)

Definition at line 28 of file verbose.h.

Referenced by stxxl::print_msg().

#define _STXXL_PRNT_LOG   (1 << 2)

Definition at line 27 of file verbose.h.

Referenced by stxxl::print_msg().

#define _STXXL_PRNT_THREAD_ID   (1 << 18)

Definition at line 31 of file verbose.h.

Referenced by stxxl::print_msg().

#define _STXXL_PRNT_TIMESTAMP   (1 << 17)

Definition at line 30 of file verbose.h.

Referenced by stxxl::print_msg().

#define STXXL_ASSERT (   condition)
#define STXXL_CHECK (   condition)
Value:
do { \
if (!(condition)) { \
_STXXL_PRINT("STXXL-CHECK", \
#condition " - FAILED @ " __FILE__ ":" << __LINE__, \
} \
} while (0)
#define _STXXL_PRINT_FLAGS_ERROR
Definition: verbose.h:34
#define _STXXL_PRINT(label, message, flags)
Definition: verbose.h:45
Examples:
examples/containers/vector_buf.cpp.

Definition at line 121 of file verbose.h.

#define STXXL_CHECK2 (   condition,
  text 
)
Value:
do { \
if (!(condition)) { \
_STXXL_PRINT("STXXL-CHECK", \
text << " - " #condition " - FAILED @ " __FILE__ ":" << __LINE__, \
} \
} while (0)
#define _STXXL_PRINT_FLAGS_ERROR
Definition: verbose.h:34
#define _STXXL_PRINT(label, message, flags)
Definition: verbose.h:45

Definition at line 130 of file verbose.h.

#define STXXL_CHECK_THROW (   code,
  exception_type 
)
Value:
do { \
bool t_ = false; try { code; } \
catch (const exception_type&) { t_ = true; } \
if (t_) break; \
_STXXL_PRINT("STXXL-CHECK-THROW", \
#code " - NO EXCEPTION " #exception_type \
" @ " __FILE__ ":" << __LINE__, \
_STXXL_PRINT_FLAGS_ERROR); \
abort(); \
} while (0)
#define _STXXL_PRINT(label, message, flags)
Definition: verbose.h:45

Definition at line 172 of file verbose.h.

#define STXXL_ERRMSG (   x)    _STXXL_PRINT("STXXL-ERRMSG", x, _STXXL_PRINT_FLAGS_ERROR)

Definition at line 79 of file verbose.h.

Referenced by stxxl::stats::_reset_io_wait_time(), stxxl::request_queue_impl_1q::add_request(), stxxl::request_queue_impl_qwqr::add_request(), stxxl::aligned_alloc(), stxxl::request::check_alignment(), stxxl::request::check_nref_failed(), stxxl::check_sort_settings(), stxxl::stream::check_sorted_runs(), stxxl::ufs_file_base::close_remove(), stxxl::disk_allocator::deallocation_error(), stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::deinitialize(), stxxl::fileperblock_file< base_file_type >::discard(), stxxl::disk_allocator::dump(), stxxl::fileperblock_file< base_file_type >::export_files(), stxxl::btree::node_cache< leaf_type, SelfType >::get_const_node(), stxxl::btree::node_cache< leaf_type, SelfType >::get_new_node(), stxxl::btree::node_cache< leaf_type, SelfType >::get_node(), stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::give_up(), stxxl::queue< ValueType, BlockSize, AllocStr, SizeType >::init(), stxxl::sequence< ValueType, BlockSize, AllocStr, SizeType >::init(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::init(), stxxl::stream::basic_runs_merger< sorted_runs_type, CompareType_, AllocStr_ >::initialize(), stxxl::config::load_default_config(), stxxl::priority_queue< ConfigType >::make_space_available(), stxxl::matrix< ValueType, BlockSideLength >::multiply(), stxxl::matrix< ValueType, BlockSideLength >::multiply_internal(), stxxl::disk_allocator::new_blocks(), stxxl::open_file_impl(), stxxl::btree::node_cache< leaf_type, SelfType >::prefetch_node(), stxxl::print_library_version_mismatch(), stxxl::random_shuffle(), stxxl::block_scheduler_algorithm_offline_lfd< SwappableBlockType >::release(), stxxl::stats::reset(), stxxl::stable_ksort(), stxxl::ufs_file_base::ufs_file_base(), stxxl::ufs_file_base::unlink(), stxxl::wfs_file_base::wfs_file_base(), stxxl::block_scheduler< SwappableBlockType >::~block_scheduler(), stxxl::block_scheduler_algorithm_offline_lfd< SwappableBlockType >::~block_scheduler_algorithm_offline_lfd(), stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::~block_scheduler_algorithm_offline_lru_prefetching(), stxxl::block_scheduler_algorithm_online_lru< SwappableBlockType >::~block_scheduler_algorithm_online_lru(), stxxl::block_scheduler_algorithm_simulation< SwappableBlockType >::~block_scheduler_algorithm_simulation(), stxxl::config::~config(), stxxl::file::~file(), stxxl::fileperblock_file< base_file_type >::~fileperblock_file(), and stxxl::vector< ValueType >::~vector().

#define STXXL_MSG (   x)    _STXXL_PRINT("STXXL-MSG", x, _STXXL_PRINT_FLAGS_DEFAULT)
Examples:
examples/algo/copy_and_sort_file.cpp, examples/algo/phonebills_genlog.cpp, examples/algo/sort_file.cpp, examples/containers/deque2.cpp, examples/containers/pqueue1.cpp, examples/containers/queue2.cpp, examples/containers/sorter2.cpp, examples/containers/stack2.cpp, and examples/containers/vector2.cpp.

Definition at line 72 of file verbose.h.

Referenced by stxxl::ufs_file_base::_after_open(), stxxl::block_manager::block_manager(), stxxl::ksort_local::check_ksorted_runs(), stxxl::sort_local::check_sorted_runs(), stxxl::stream::check_sorted_runs(), stxxl::swappable_block< ValueType, BlockSideLength *BlockSideLength >::clean_async(), stxxl::config::config(), stxxl::block_scheduler_algorithm_offline_lru_prefetching< SwappableBlockType >::deinit(), stxxl::priority_queue< ConfigType >::dump_params(), stxxl::priority_queue< ConfigType >::dump_sizes(), stxxl::queue< ValueType, BlockSize, AllocStr, SizeType >::init(), stxxl::sequence< ValueType, BlockSize, AllocStr, SizeType >::init(), stxxl::stream::basic_runs_merger< RunsType_, CompareType_, AllocStr_ >::merge_recursively(), stxxl::open_file_impl(), stxxl::swappable_block< ValueType, BlockSideLength *BlockSideLength >::read_async(), stxxl::priority_queue< ConfigType >::refill_delete_buffer(), stxxl::priority_queue< ConfigType >::refill_group_buffer(), stxxl::simple_vector< stxxl::counting_ptr >::resize(), stxxl::stream::basic_runs_creator< stream::use_push< ValueType >, cmp_type, BlockSize_, alloc_strategy_type >::result(), stxxl::stream::runs_creator< use_push< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::result(), stxxl::scoped_print_timer::scoped_print_timer(), stxxl::stable_ksort(), stxxl::ufs_file_base::ufs_file_base(), and stxxl::scoped_print_timer::~scoped_print_timer().

#define STXXL_VERBOSE0 (   x)    _STXXL_NOT_VERBOSE

Definition at line 93 of file verbose.h.

#define STXXL_VERBOSE1 (   x)    _STXXL_NOT_VERBOSE

Definition at line 99 of file verbose.h.

Referenced by stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, LogNElem_, BTreeType >::balance(), stxxl::btree::normal_node< KeyType_, KeyCmp_, RawSize_, BTreeType >::begin(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::begin(), stxxl::block_prefetcher< block_type, bid_iterator_type >::block_consumed(), stxxl::block_prefetcher< block_type, bid_iterator_type >::block_prefetcher(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::btree(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::bulk_construction(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::compact_tree(), stxxl::compute_prefetch_schedule(), stxxl::stream::basic_runs_creator< Input_, CompareType_, BlockSize_, AllocStr_ >::compute_result(), stxxl::stream::runs_creator< use_push< ValueType_ >, CompareType_, BlockSize_, AllocStr_ >::compute_result(), stxxl::sort_helper::count_elements_less_equal(), stxxl::sort_local::create_runs(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::deallocate_segment(), stxxl::btree::node_cache< leaf_type, SelfType >::delete_node(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::double_k(), stxxl::btree::normal_node< KeyType_, KeyCmp_, RawSize_, BTreeType >::erase(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::erase(), stxxl::stream::basic_runs_merger< sorted_runs_type, CompareType_, AllocStr_ >::fill_buffer_block(), stxxl::btree::normal_node< KeyType_, KeyCmp_, RawSize_, BTreeType >::find(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::find(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, LogNElem_, BTreeType >::fuse(), stxxl::btree::node_cache< leaf_type, SelfType >::get_const_node(), stxxl::btree::node_cache< leaf_type, SelfType >::get_new_node(), stxxl::btree::node_cache< leaf_type, SelfType >::get_node(), stxxl::prefetch_pool< BlockType >::hint(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, LogNElem_, BTreeType >::increment_iterator(), stxxl::stream::basic_runs_merger< sorted_runs_type, CompareType_, AllocStr_ >::initialize(), stxxl::btree::normal_node< KeyType_, KeyCmp_, RawSize_, BTreeType >::insert(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::insert(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::insert_into_root(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::insert_segment(), stxxl::btree::normal_node< KeyType_, KeyCmp_, RawSize_, BTreeType >::lower_bound(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::lower_bound(), stxxl::priority_queue< ConfigType >::make_space_available(), stxxl::sort_local::merge_runs(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::multi_merge(), stxxl::disk_allocator::new_blocks(), stxxl::btree::node_cache< leaf_type, SelfType >::node_cache(), stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::operator new(), stxxl::typed_block< RawSize, Type, NRef, MetaInfoType >::operator new[](), stxxl::sequence< ValueType, BlockSize, AllocStr, SizeType >::stream::operator++(), stxxl::sequence< ValueType, BlockSize, AllocStr, SizeType >::reverse_stream::operator++(), stxxl::queue< ValueType, BlockSize, AllocStr, SizeType >::pop(), stxxl::sequence< ValueType, BlockSize, AllocStr, SizeType >::pop_back(), stxxl::sequence< ValueType, BlockSize, AllocStr, SizeType >::pop_front(), stxxl::btree::node_cache< leaf_type, SelfType >::prefetch_node(), stxxl::block_prefetcher< block_type, bid_iterator_type >::pull_block(), stxxl::queue< ValueType, BlockSize, AllocStr, SizeType >::push(), stxxl::sequence< ValueType, BlockSize, AllocStr, SizeType >::push_back(), stxxl::sequence< ValueType, BlockSize, AllocStr, SizeType >::push_front(), stxxl::random_shuffle(), stxxl::prefetch_pool< BlockType >::read(), stxxl::sort_helper::refill_or_remove_empty_sequences(), stxxl::async_schedule_local::simulate_async_write(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, LogNElem_, BTreeType >::split(), stxxl::stream::streamify(), stxxl::stream::streamify_sr(), stxxl::btree::node_cache< leaf_type, SelfType >::unfix_node(), stxxl::btree::normal_node< KeyType_, KeyCmp_, RawSize_, BTreeType >::upper_bound(), stxxl::btree::btree< KeyType, DataType, CompareType, RawNodeSize, RawLeafSize, PDAllocStrategy >::upper_bound(), stxxl::stream::vector_iterator2stream_sr< InputIterator_ >::vector_iterator2stream_sr(), stxxl::block_prefetcher< block_type, bid_iterator_type >::wait(), stxxl::block_manager::~block_manager(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::~ext_merger(), stxxl::priority_queue_local::loser_tree< ValTp_, Cmp_, KNKMAX >::~loser_tree(), and stxxl::btree::node_cache< leaf_type, SelfType >::~node_cache().

#define STXXL_VERBOSE2 (   x)    _STXXL_NOT_VERBOSE

Definition at line 107 of file verbose.h.

Referenced by stxxl::disk_allocator::add_free_region(), stxxl::aligned_alloc(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, LogNElem_, BTreeType >::balance(), stxxl::stream::check_sorted_runs(), stxxl::serving_request::completed(), stxxl::priority_queue_local::loser_tree< ValTp_, Cmp_, KNKMAX >::deallocate_segment(), stxxl::disk_allocator::delete_block(), stxxl::fileperblock_file< base_file_type >::discard(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, LogNElem_, BTreeType >::dump(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, LogNElem_, BTreeType >::erase(), stxxl::btree::normal_leaf< KeyType_, DataType_, KeyCmp_, LogNElem_, BTreeType >::fuse(), stxxl::grow_shrink_stack2< StackConfig >::grow_shrink_stack2(), stxxl::prefetch_pool< BlockType >::hint(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::init(), stxxl::priority_queue_local::loser_tree< ValTp_, Cmp_, KNKMAX >::insert_segment(), stxxl::loser_tree< run_cursor_type, run_cursor_cmp_type >::loser_tree(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::multi_merge(), stxxl::disk_allocator::new_blocks(), stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::sequence_state::operator++(), stxxl::normal_stack< StackConfig >::pop(), stxxl::grow_shrink_stack< StackConfig >::pop(), stxxl::grow_shrink_stack2< StackConfig >::pop(), stxxl::normal_stack< StackConfig >::push(), stxxl::grow_shrink_stack< StackConfig >::push(), stxxl::grow_shrink_stack2< StackConfig >::push(), stxxl::btree::iterator_map< SelfType >::register_iterator(), stxxl::serving_request::serve(), stxxl::btree::iterator_map< SelfType >::unregister_iterator(), stxxl::request_queue_impl_qwqr::worker(), stxxl::grow_shrink_stack2< StackConfig >::~grow_shrink_stack2(), stxxl::priority_queue_local::loser_tree< ValTp_, Cmp_, KNKMAX >::~loser_tree(), and stxxl::priority_queue_local::ext_merger< BlockType_, Cmp_, Arity_, AllocStr_ >::sequence_state::~sequence_state().

#define STXXL_VERBOSE_LEVEL   -1

Definition at line 67 of file verbose.h.