Struct Logger

Inheritance Relationships

Base Type

Struct Documentation

struct Logger : public sequant::Singleton<Logger>

controls logging within SeQuant components, only useful for troubleshooting/learning

Public Members

bool wick_harness = false
bool wick_topology = false
bool wick_contract = false
bool wick_reduce = false
bool wick_stats = false
bool expand = false
bool canonicalize = false
bool canonicalize_input_graph = false
bool canonicalize_dot = false
bool simplify = false
bool tensor_network = false
bool export_equations = false
size_t level

Evaluation log verbosity level 0: No log. 1: Log what is being evaluated in the evaluation tree (independent of tensor algebra backend (TA/BTAS etc.) 2: Also log invocation of tensor algebra backend within sequant. 3: Also log TiledArray memory use.

std::ostream *stream

the stream for logging; can be set to nullptr

std::function<std::size_t(std::size_t)> rss_reduce = {}

Optional reducer for the per-op RSS reported in the eval trace: maps this rank’s local RSS (bytes) to the value to report (e.g. the sum over all ranks = true total app memory, instead of a misleading single-rank RSS). Injected by the tensor-algebra backend, which holds the World needed for a collective reduction. The eval log path runs on EVERY rank (printing() is level>0, identical across ranks), so a collective reducer here is matched across ranks. Empty = report this rank’s RSS unchanged.

std::function<std::string()> heap_stats = {}

Optional supplier of an extra, backend-defined suffix appended to each eval-trace line: after the rss field of an Eval record, after the bytes field of a Batch

record (a batch step’s Slice, Scatter, Accumulate or Materialize, so the hook is called once per such movement too). Injected by the tensor-algebra backend to report allocator-level memory that RSS alone cannot distinguish – e.g. glibc all-arena in-use vs system bytes, so one can tell live heap from retained-free heap right at an RSS jump. Runs on every rank on the eval log path (printing() is level>0, identical across ranks), so an injected collective reduction here is matched across ranks. Returns a preformatted, already-reduced string (e.g. “heap_inuse=…B |

heap_sys=…B”); empty function = omit the suffix.

std::function<void()> release_memory = {}

Optional post-op memory-release hook, invoked after each freshly evaluated op (leaf/product/sum) regardless of trace level – so a large transient’s freed pages can be returned to the OS before the next op allocates, rather than lingering as allocator-retained free heap. The injected hook is expected to self-throttle (a cheap no-op when little is reclaimable) since it runs per op. Local/non-collective by contract (e.g. glibc malloc_trim), so it needs no cross-rank matching. Empty function = no release (default).

std::function<std::string(std::size_t hash)> node_meta = {}

Optional per-node metadata provider, keyed by a node’s EvalExpr::hash_value(). When set, the per-op trace annotation (see log::slice_home_annot) appends this provider’s string for the node, so a line can also carry schedule properties the running annotation cannot see – e.g. the value’s home scope and its use scopes. Consulted only under log::printing() at the trace-emission sites; empty function = nothing appended (default), so the annotation carries nothing beyond the running one.

std::size_t placement = 0

How much the eval trace reports on where the data of each operand and result of an op lives across processes (appended to the layout a Result::trange_annot reports; a backend whose data is not distributed appends nothing): 0: nothing (default). 1: the kind of the process map that places the data. 2: also the spread of the data’s bytes over the processes: the busiest process’s bytes relative to the mean, those bytes, and the total. 3 (or more): also the bytes on each process, one entry per process. Levels 2 and 3 cost collective reductions per reported value, so they slow the evaluation down, and their messages count towards any inter-process traffic a heap_stats hook reports for the op; like level the value must be identical across ranks. Reported only while the trace is printed (level > 0).

struct sequant::Logger eval = {0, nullptr, {}, {}, {}, {}, 0}