timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::node::tree< Tp > Struct Template Reference

This data type is used when rendering the hierarchical representation (i.e. requires recursion) representation of the calling-context. The prefix here has no decoration. More...

#include "timemory/storage/node.hpp"

+ Collaboration diagram for tim::node::tree< Tp >:

Public Types

using this_type = tree
 
using base_type = typename data< Tp >::tree_type
 
using data_value_type = typename Tp::value_type
 
using data_base_type = typename Tp::base_type
 
using stats_type = typename data< Tp >::stats_type
 
using entry_type = typename data< Tp >::entry_type
 
using idset_type = typename data< Tp >::idset_type
 
using string_t = std::string
 

Public Member Functions

 tree ()
 
 tree (base_type &&_base) noexcept
 
 tree (const graph< Tp > &)
 
treeoperator= (const graph< Tp > &)
 
 ~tree ()=default
 
 tree (const tree &)=default
 
 tree (tree &&) noexcept=default
 
 tree (bool _is_dummy, uint32_t _tid, uint32_t _pid, uint64_t _hash, int64_t _depth, const Tp &_obj)
 
bool operator== (const tree &rhs) const
 
bool operator!= (const tree &rhs) const
 
treeoperator= (const tree &)=default
 
treeoperator= (tree &&) noexcept=default
 
this_typeoperator+= (const this_type &rhs)
 
this_typeoperator-= (const this_type &rhs)
 
bool & is_dummy ()
 returns whether or not this node is a synchronization point and, if so, should be ignored More...
 
uint64_t & hash ()
 returns the hash identifier for the associated string identifier More...
 
int64_t & depth ()
 returns the depth of the node in the tree. NOTE: this value may be relative to dummy nodes More...
 
idset_typetid ()
 the set of thread ids this data was collected from More...
 
idset_typepid ()
 the set of process ids this data was collected from More...
 
entry_typeinclusive ()
 the inclusive data + statistics More...
 
entry_typeexclusive ()
 the exclusive data + statistics More...
 
const bool & is_dummy () const
 
const uint64_t & hash () const
 
const int64_t & depth () const
 
const idset_typetid () const
 
const idset_typepid () const
 
const entry_typeinclusive () const
 
const entry_typeexclusive () const
 

Static Public Member Functions

static Tp get_dummy ()
 

Detailed Description

template<typename Tp>
struct tim::node::tree< Tp >

This data type is used when rendering the hierarchical representation (i.e. requires recursion) representation of the calling-context. The prefix here has no decoration.

Template Parameters
TpGenerally tim::basic_tree<ComponentT>

Definition at line 322 of file node.hpp.

Member Typedef Documentation

◆ base_type

template<typename Tp >
using tim::node::tree< Tp >::base_type = typename data<Tp>::tree_type

Definition at line 325 of file node.hpp.

◆ data_base_type

template<typename Tp >
using tim::node::tree< Tp >::data_base_type = typename Tp::base_type

Definition at line 327 of file node.hpp.

◆ data_value_type

template<typename Tp >
using tim::node::tree< Tp >::data_value_type = typename Tp::value_type

Definition at line 326 of file node.hpp.

◆ entry_type

template<typename Tp >
using tim::node::tree< Tp >::entry_type = typename data<Tp>::entry_type

Definition at line 329 of file node.hpp.

◆ idset_type

template<typename Tp >
using tim::node::tree< Tp >::idset_type = typename data<Tp>::idset_type

Definition at line 330 of file node.hpp.

◆ stats_type

template<typename Tp >
using tim::node::tree< Tp >::stats_type = typename data<Tp>::stats_type

Definition at line 328 of file node.hpp.

◆ string_t

template<typename Tp >
using tim::node::tree< Tp >::string_t = std::string

Definition at line 331 of file node.hpp.

◆ this_type

template<typename Tp >
using tim::node::tree< Tp >::this_type = tree

Definition at line 324 of file node.hpp.

Constructor & Destructor Documentation

◆ tree() [1/6]

template<typename Tp >
tim::node::tree< Tp >::tree

Definition at line 461 of file node.hpp.

462: base_type(false, 0, 0, idset_type{ threading::get_id() },
463 idset_type{ process::get_id() }, entry_type{}, entry_type{})
464{}
typename data< Tp >::entry_type entry_type
Definition: node.hpp:329
typename data< Tp >::idset_type idset_type
Definition: node.hpp:330
typename data< Tp >::tree_type base_type
Definition: node.hpp:325

◆ tree() [2/6]

template<typename Tp >
tim::node::tree< Tp >::tree ( base_type &&  _base)
explicitnoexcept

◆ tree() [3/6]

template<typename Tp >
tim::node::tree< Tp >::tree ( const graph< Tp > &  rhs)

Definition at line 469 of file node.hpp.

470: base_type(rhs.is_dummy(), rhs.hash(), rhs.depth(), idset_type{ rhs.tid() },
471 idset_type{ rhs.pid() }, entry_type{ rhs.data(), rhs.stats() },
472 entry_type{ rhs.data(), rhs.stats() })
473{}

◆ ~tree()

template<typename Tp >
tim::node::tree< Tp >::~tree ( )
default

◆ tree() [4/6]

template<typename Tp >
tim::node::tree< Tp >::tree ( const tree< Tp > &  )
default

◆ tree() [5/6]

template<typename Tp >
tim::node::tree< Tp >::tree ( tree< Tp > &&  )
defaultnoexcept

◆ tree() [6/6]

template<typename Tp >
tim::node::tree< Tp >::tree ( bool  _is_dummy,
uint32_t  _tid,
uint32_t  _pid,
uint64_t  _hash,
int64_t  _depth,
const Tp &  _obj 
)

Member Function Documentation

◆ depth() [1/2]

template<typename Tp >
int64_t & tim::node::tree< Tp >::depth ( )
inline

returns the depth of the node in the tree. NOTE: this value may be relative to dummy nodes

Definition at line 381 of file node.hpp.

381{ return std::get<2>(*this); }

Referenced by tim::cereal::load(), and tim::cereal::save().

◆ depth() [2/2]

template<typename Tp >
const int64_t & tim::node::tree< Tp >::depth ( ) const
inline

Definition at line 397 of file node.hpp.

397{ return std::get<2>(*this); }

◆ exclusive() [1/2]

template<typename Tp >
entry_type & tim::node::tree< Tp >::exclusive ( )
inline

the exclusive data + statistics

Definition at line 393 of file node.hpp.

393{ return std::get<6>(*this); }

Referenced by tim::cereal::load(), tim::node::tree< Tp >::operator+=(), tim::node::tree< Tp >::operator-=(), and tim::cereal::save().

◆ exclusive() [2/2]

template<typename Tp >
const entry_type & tim::node::tree< Tp >::exclusive ( ) const
inline

Definition at line 401 of file node.hpp.

401{ return std::get<6>(*this); }

◆ get_dummy()

template<typename Tp >
static Tp tim::node::tree< Tp >::get_dummy ( )
static

◆ hash() [1/2]

template<typename Tp >
uint64_t & tim::node::tree< Tp >::hash ( )
inline

returns the hash identifier for the associated string identifier

Definition at line 377 of file node.hpp.

377{ return std::get<1>(*this); }

Referenced by tim::cereal::load(), and tim::cereal::save().

◆ hash() [2/2]

template<typename Tp >
const uint64_t & tim::node::tree< Tp >::hash ( ) const
inline

Definition at line 396 of file node.hpp.

396{ return std::get<1>(*this); }

◆ inclusive() [1/2]

template<typename Tp >
entry_type & tim::node::tree< Tp >::inclusive ( )
inline

the inclusive data + statistics

Definition at line 390 of file node.hpp.

390{ return std::get<5>(*this); }

Referenced by tim::cereal::load(), tim::node::tree< Tp >::operator+=(), tim::node::tree< Tp >::operator-=(), and tim::cereal::save().

◆ inclusive() [2/2]

template<typename Tp >
const entry_type & tim::node::tree< Tp >::inclusive ( ) const
inline

Definition at line 400 of file node.hpp.

400{ return std::get<5>(*this); }

◆ is_dummy() [1/2]

template<typename Tp >
bool & tim::node::tree< Tp >::is_dummy ( )
inline

returns whether or not this node is a synchronization point and, if so, should be ignored

Definition at line 374 of file node.hpp.

374{ return std::get<0>(*this); }

Referenced by tim::cereal::load(), and tim::cereal::save().

◆ is_dummy() [2/2]

template<typename Tp >
const bool & tim::node::tree< Tp >::is_dummy ( ) const
inline

Definition at line 395 of file node.hpp.

395{ return std::get<0>(*this); }

◆ operator!=()

template<typename Tp >
bool tim::node::tree< Tp >::operator!= ( const tree< Tp > &  rhs) const

◆ operator+=()

template<typename Tp >
this_type & tim::node::tree< Tp >::operator+= ( const this_type rhs)
inline

Definition at line 353 of file node.hpp.

354 {
355 inclusive() += rhs.inclusive();
356 exclusive() += rhs.exclusive();
357 for(const auto& itr : rhs.tid())
358 tid().insert(itr);
359 for(const auto& itr : rhs.pid())
360 pid().insert(itr);
361 return *this;
362 }
entry_type & inclusive()
the inclusive data + statistics
Definition: node.hpp:390
idset_type & pid()
the set of process ids this data was collected from
Definition: node.hpp:387
idset_type & tid()
the set of thread ids this data was collected from
Definition: node.hpp:384
entry_type & exclusive()
the exclusive data + statistics
Definition: node.hpp:393

References tim::node::tree< Tp >::exclusive(), tim::node::tree< Tp >::inclusive(), tim::node::tree< Tp >::pid(), and tim::node::tree< Tp >::tid().

◆ operator-=()

template<typename Tp >
this_type & tim::node::tree< Tp >::operator-= ( const this_type rhs)
inline

Definition at line 364 of file node.hpp.

365 {
366 inclusive() -= rhs.inclusive();
367 exclusive() -= rhs.exclusive();
368 return *this;
369 }

References tim::node::tree< Tp >::exclusive(), and tim::node::tree< Tp >::inclusive().

◆ operator=() [1/3]

template<typename Tp >
tree< Tp > & tim::node::tree< Tp >::operator= ( const graph< Tp > &  rhs)

Definition at line 479 of file node.hpp.

480{
481 is_dummy() = rhs.is_dummy();
482 hash() = rhs.hash();
483 depth() = rhs.depth();
484 tid() = { rhs.tid() };
485 pid() = { rhs.pid() };
486 inclusive() = entry_type{ rhs.data(), rhs.stats() };
487 exclusive() = entry_type{ rhs.data(), rhs.stats() };
488 return *this;
489}
int64_t & depth()
returns the depth of the node in the tree. NOTE: this value may be relative to dummy nodes
Definition: node.hpp:381
uint64_t & hash()
returns the hash identifier for the associated string identifier
Definition: node.hpp:377
bool & is_dummy()
returns whether or not this node is a synchronization point and, if so, should be ignored
Definition: node.hpp:374

References tim::node::graph< Tp >::data(), tim::node::graph< Tp >::depth(), tim::node::graph< Tp >::hash(), tim::node::graph< Tp >::is_dummy(), tim::node::graph< Tp >::pid(), tim::node::graph< Tp >::stats(), and tim::node::graph< Tp >::tid().

◆ operator=() [2/3]

template<typename Tp >
tree & tim::node::tree< Tp >::operator= ( const tree< Tp > &  )
default

◆ operator=() [3/3]

template<typename Tp >
tree & tim::node::tree< Tp >::operator= ( tree< Tp > &&  )
defaultnoexcept

◆ operator==()

template<typename Tp >
bool tim::node::tree< Tp >::operator== ( const tree< Tp > &  rhs) const

◆ pid() [1/2]

template<typename Tp >
idset_type & tim::node::tree< Tp >::pid ( )
inline

the set of process ids this data was collected from

Definition at line 387 of file node.hpp.

387{ return std::get<4>(*this); }

Referenced by tim::cereal::load(), tim::node::tree< Tp >::operator+=(), and tim::cereal::save().

◆ pid() [2/2]

template<typename Tp >
const idset_type & tim::node::tree< Tp >::pid ( ) const
inline

Definition at line 399 of file node.hpp.

399{ return std::get<4>(*this); }

◆ tid() [1/2]

template<typename Tp >
idset_type & tim::node::tree< Tp >::tid ( )
inline

the set of thread ids this data was collected from

Definition at line 384 of file node.hpp.

384{ return std::get<3>(*this); }

Referenced by tim::cereal::load(), tim::node::tree< Tp >::operator+=(), and tim::cereal::save().

◆ tid() [2/2]

template<typename Tp >
const idset_type & tim::node::tree< Tp >::tid ( ) const
inline

Definition at line 398 of file node.hpp.

398{ return std::get<3>(*this); }

The documentation for this struct was generated from the following files: