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::cereal Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  specialize< Archive, tim::node::entry< Tp, StatT >, cereal::specialization::non_member_load_save >
 
struct  specialize< Archive, tim::node::graph< Tp >, cereal::specialization::non_member_load_save >
 
struct  specialize< Archive, tim::node::result< Tp >, cereal::specialization::non_member_load_save >
 
struct  specialize< Archive, tim::node::tree< Tp >, cereal::specialization::non_member_load_save >
 

Functions

template<typename Archive , typename Tp >
void save (Archive &ar, std::shared_ptr< tim::tsettings< Tp, Tp & > > obj)
 
template<typename Archive , typename Tp >
void save (Archive &ar, const tim::node::graph< Tp > &d)
 
template<typename Archive , typename Tp >
void load (Archive &ar, tim::node::graph< Tp > &d)
 
template<typename Archive , typename Tp , typename StatT >
void save (Archive &ar, const tim::node::entry< Tp, StatT > &e)
 
template<typename Archive , typename Tp , typename StatT >
void load (Archive &ar, tim::node::entry< Tp, StatT > &e)
 
template<typename Archive , typename Tp >
void save (Archive &ar, const tim::node::tree< Tp > &t)
 
template<typename Archive , typename Tp >
void load (Archive &ar, tim::node::tree< Tp > &t)
 
template<typename Archive , typename Tp >
void save (Archive &ar, const tim::node::result< Tp > &r)
 
template<typename Archive , typename Tp >
void load (Archive &ar, tim::node::result< Tp > &r)
 
template<typename Archive , typename Tp >
void save (Archive &ar, const std::vector< tim::node::result< Tp > > &result_nodes)
 
template<typename Archive , typename Tp >
void load (Archive &ar, std::vector< tim::node::result< Tp > > &result_nodes)
 

Class Documentation

◆ tim::cereal::specialize< Archive, tim::node::entry< Tp, StatT >, cereal::specialization::non_member_load_save >

struct tim::cereal::specialize< Archive, tim::node::entry< Tp, StatT >, cereal::specialization::non_member_load_save >
template<typename Archive, typename Tp, typename StatT>
struct tim::cereal::specialize< Archive, tim::node::entry< Tp, StatT >, cereal::specialization::non_member_load_save >

Definition at line 562 of file node.hpp.

+ Collaboration diagram for tim::cereal::specialize< Archive, tim::node::entry< Tp, StatT >, cereal::specialization::non_member_load_save >:

◆ tim::cereal::specialize< Archive, tim::node::graph< Tp >, cereal::specialization::non_member_load_save >

struct tim::cereal::specialize< Archive, tim::node::graph< Tp >, cereal::specialization::non_member_load_save >
template<typename Archive, typename Tp>
struct tim::cereal::specialize< Archive, tim::node::graph< Tp >, cereal::specialization::non_member_load_save >

Definition at line 535 of file node.hpp.

+ Collaboration diagram for tim::cereal::specialize< Archive, tim::node::graph< Tp >, cereal::specialization::non_member_load_save >:

◆ tim::cereal::specialize< Archive, tim::node::result< Tp >, cereal::specialization::non_member_load_save >

struct tim::cereal::specialize< Archive, tim::node::result< Tp >, cereal::specialization::non_member_load_save >
template<typename Archive, typename Tp>
struct tim::cereal::specialize< Archive, tim::node::result< Tp >, cereal::specialization::non_member_load_save >

Definition at line 674 of file node.hpp.

+ Collaboration diagram for tim::cereal::specialize< Archive, tim::node::result< Tp >, cereal::specialization::non_member_load_save >:

◆ tim::cereal::specialize< Archive, tim::node::tree< Tp >, cereal::specialization::non_member_load_save >

struct tim::cereal::specialize< Archive, tim::node::tree< Tp >, cereal::specialization::non_member_load_save >
template<typename Archive, typename Tp>
struct tim::cereal::specialize< Archive, tim::node::tree< Tp >, cereal::specialization::non_member_load_save >

Definition at line 601 of file node.hpp.

+ Collaboration diagram for tim::cereal::specialize< Archive, tim::node::tree< Tp >, cereal::specialization::non_member_load_save >:

Function Documentation

◆ load() [1/5]

template<typename Archive , typename Tp >
void tim::cereal::load ( Archive &  ar,
std::vector< tim::node::result< Tp > > &  result_nodes 
)

Definition at line 654 of file node.hpp.

655{
656 size_t nnodes = 0;
657 ar(cereal::make_nvp("graph_size", nnodes));
658 result_nodes.resize(nnodes);
659
660 ar.setNextName("graph");
661 ar.startNode();
662 for(auto& itr : result_nodes)
663 {
664 ar.startNode();
665 load(ar, itr);
666 ar.finishNode();
667 }
668 ar.finishNode();
669}
void load(Archive &ar, std::vector< tim::node::result< Tp > > &result_nodes)
Definition: node.hpp:654

References load().

◆ load() [2/5]

template<typename Archive , typename Tp , typename StatT >
void tim::cereal::load ( Archive &  ar,
tim::node::entry< Tp, StatT > &  e 
)

Definition at line 553 of file node.hpp.

554{
555 ar(cereal::make_nvp("entry", e.data()));
556 ar(cereal::make_nvp("stats", e.stats()));
557}
Tp & data()
component object with either inclusive or exclusive values
Definition: node.hpp:84
StatT & stats()
statistics data with either inclusive or exclusive values
Definition: node.hpp:87

References tim::node::entry< Tp, StatT >::data(), and tim::node::entry< Tp, StatT >::stats().

◆ load() [3/5]

template<typename Archive , typename Tp >
void tim::cereal::load ( Archive &  ar,
tim::node::graph< Tp > &  d 
)

Definition at line 520 of file node.hpp.

521{
523 ar(cereal::make_nvp("hash", d.id()), cereal::make_nvp("prefix", _prefix),
524 cereal::make_nvp("entry", d.obj()), cereal::make_nvp("depth", d.depth()),
525 cereal::make_nvp("stats", d.stats()), cereal::make_nvp("tid", d.tid()),
526 cereal::make_nvp("pid", d.pid()), cereal::make_nvp("dummy", d.is_dummy()));
527 auto _id = tim::add_hash_id(_prefix);
528 if(_id != d.id())
529 tim::add_hash_id(_id, d.id());
530}
hash_value_t add_hash_id(hash_map_ptr_t &_hash_map, string_view_cref_t _prefix)
add an string to the given hash-map (if it doesn't already exist) and return the hash
Definition: types.hpp:190
char const std::string & _prefix
Definition: config.cpp:55
tim::mpl::apply< std::string > string
Definition: macros.hpp:53
int64_t & depth()
depth in call-graph
Definition: node.hpp:192
stats_type & stats()
statistics data for entry in call-graph
Definition: node.hpp:198
bool & is_dummy()
denotes this is a placeholder for synchronization
Definition: node.hpp:180
uint64_t & id()
hash identifer
Definition: node.hpp:189
uint32_t & pid()
process identifier
Definition: node.hpp:186
Tp & obj()
this is the instance that gets updated in call-graph
Definition: node.hpp:195
uint32_t & tid()
thread identifier
Definition: node.hpp:183

References tim::_prefix, tim::node::graph< Tp >::depth(), tim::node::graph< Tp >::id(), tim::node::graph< Tp >::is_dummy(), tim::node::graph< Tp >::obj(), tim::node::graph< Tp >::pid(), tim::node::graph< Tp >::stats(), and tim::node::graph< Tp >::tid().

Referenced by tim::trace::lock< Tp, false >::exchange(), tim::component::peak_rss::get(), tim::component::current_peak_rss::get(), tim::env_settings::insert(), tim::component::base< Tp, Value >::load(), and load().

◆ load() [4/5]

template<typename Archive , typename Tp >
void tim::cereal::load ( Archive &  ar,
tim::node::result< Tp > &  r 
)

Definition at line 622 of file node.hpp.

623{
624 ar(cereal::make_nvp("hash", r.hash()), cereal::make_nvp("prefix", r.prefix()),
625 cereal::make_nvp("depth", r.depth()), cereal::make_nvp("entry", r.data()),
626 cereal::make_nvp("stats", r.stats()),
627 cereal::make_nvp("rolling_hash", r.rolling_hash()));
628 // ar(cereal::make_nvp("hierarchy", r.hierarchy()));
629}
int64_t & depth()
depth of the node in the calling-context
Definition: node.hpp:253
string_t & prefix()
the associated string with the hash + indentation and other decoration
Definition: node.hpp:262
uint64_t & hash()
hash identifer of the node
Definition: node.hpp:256
uint64_t & rolling_hash()
the summation of this hash and it's parent hashes
Definition: node.hpp:259
Tp & data()
reference to the component
Definition: node.hpp:268
stats_type & stats()
reference to the associate statistical accumulation of the data (if any)
Definition: node.hpp:271

References tim::node::result< Tp >::data(), tim::node::result< Tp >::depth(), tim::node::result< Tp >::hash(), tim::node::result< Tp >::prefix(), tim::node::result< Tp >::rolling_hash(), and tim::node::result< Tp >::stats().

◆ load() [5/5]

template<typename Archive , typename Tp >
void tim::cereal::load ( Archive &  ar,
tim::node::tree< Tp > &  t 
)

Definition at line 585 of file node.hpp.

586{
588 ar(cereal::make_nvp("hash", t.hash()), cereal::make_nvp("prefix", _prefix),
589 cereal::make_nvp("tid", t.tid()), cereal::make_nvp("pid", t.pid()),
590 cereal::make_nvp("depth", t.depth()), cereal::make_nvp("is_dummy", t.is_dummy()));
591 ar(cereal::make_nvp("inclusive", t.inclusive()));
592 ar(cereal::make_nvp("exclusive", t.exclusive()));
593 auto _id = tim::add_hash_id(_prefix);
594 if(_id != t.hash())
595 tim::add_hash_id(_id, t.hash());
596}
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
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
uint64_t & hash()
returns the hash identifier for the associated string identifier
Definition: node.hpp:377
idset_type & tid()
the set of thread ids this data was collected from
Definition: node.hpp:384
bool & is_dummy()
returns whether or not this node is a synchronization point and, if so, should be ignored
Definition: node.hpp:374
entry_type & exclusive()
the exclusive data + statistics
Definition: node.hpp:393

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

◆ save() [1/6]

template<typename Archive , typename Tp >
void tim::cereal::save ( Archive &  ar,
const std::vector< tim::node::result< Tp > > &  result_nodes 
)

Definition at line 635 of file node.hpp.

636{
637 ar(cereal::make_nvp("graph_size", result_nodes.size()));
638 ar.setNextName("graph");
639 ar.startNode();
640 ar.makeArray();
641 for(const auto& itr : result_nodes)
642 {
643 ar.startNode();
644 save(ar, itr);
645 ar.finishNode();
646 }
647 ar.finishNode();
648}
void save(Archive &ar, const std::vector< tim::node::result< Tp > > &result_nodes)
Definition: node.hpp:635

References save().

◆ save() [2/6]

template<typename Archive , typename Tp , typename StatT >
void tim::cereal::save ( Archive &  ar,
const tim::node::entry< Tp, StatT > &  e 
)

Definition at line 543 of file node.hpp.

544{
545 ar(cereal::make_nvp("entry", e.data()));
546 ar(cereal::make_nvp("stats", e.stats()));
547}

References tim::node::entry< Tp, StatT >::data(), and tim::node::entry< Tp, StatT >::stats().

◆ save() [3/6]

template<typename Archive , typename Tp >
void tim::cereal::save ( Archive &  ar,
const tim::node::graph< Tp > &  d 
)

Definition at line 507 of file node.hpp.

508{
510 ar(cereal::make_nvp("hash", d.id()), cereal::make_nvp("prefix", _prefix),
511 cereal::make_nvp("entry", d.obj()), cereal::make_nvp("depth", d.depth()),
512 cereal::make_nvp("stats", d.stats()), cereal::make_nvp("tid", d.tid()),
513 cereal::make_nvp("pid", d.pid()), cereal::make_nvp("dummy", d.is_dummy()));
514}
bool get_hash_identifier(const hash_map_ptr_t &_hash_map, const hash_alias_ptr_t &_hash_alias, hash_value_t _hash_id, std::string *&_ret)
This class post-processes strings for a given API.
Definition: decode.hpp:49

References tim::_prefix, tim::node::graph< Tp >::depth(), tim::node::graph< Tp >::id(), tim::node::graph< Tp >::is_dummy(), tim::node::graph< Tp >::obj(), tim::node::graph< Tp >::pid(), tim::node::graph< Tp >::stats(), and tim::node::graph< Tp >::tid().

◆ save() [4/6]

template<typename Archive , typename Tp >
void tim::cereal::save ( Archive &  ar,
const tim::node::result< Tp > &  r 
)

Definition at line 609 of file node.hpp.

610{
611 ar(cereal::make_nvp("hash", r.hash()), cereal::make_nvp("prefix", r.prefix()),
612 cereal::make_nvp("depth", r.depth()), cereal::make_nvp("entry", r.data()),
613 cereal::make_nvp("stats", r.stats()),
614 cereal::make_nvp("rolling_hash", r.rolling_hash()));
615 // ar(cereal::make_nvp("hierarchy", r.hierarchy()));
616}

References tim::node::result< Tp >::data(), tim::node::result< Tp >::depth(), tim::node::result< Tp >::hash(), tim::node::result< Tp >::prefix(), tim::node::result< Tp >::rolling_hash(), and tim::node::result< Tp >::stats().

◆ save() [5/6]

template<typename Archive , typename Tp >
void tim::cereal::save ( Archive &  ar,
const tim::node::tree< Tp > &  t 
)

Definition at line 570 of file node.hpp.

571{
572 auto _prefix =
574 ar(cereal::make_nvp("hash", t.hash()), cereal::make_nvp("prefix", _prefix),
575 cereal::make_nvp("tid", t.tid()), cereal::make_nvp("pid", t.pid()),
576 cereal::make_nvp("depth", t.depth()), cereal::make_nvp("is_dummy", t.is_dummy()));
577 ar(cereal::make_nvp("inclusive", t.inclusive()));
578 ar(cereal::make_nvp("exclusive", t.exclusive()));
579}

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

◆ save() [6/6]

template<typename Archive , typename Tp >
void tim::cereal::save ( Archive &  ar,
std::shared_ptr< tim::tsettings< Tp, Tp & > >  obj 
)

Definition at line 471 of file tsettings.hpp.

472{
473 auto _obj = obj->clone();
474 ar(_obj);
475}

Referenced by save().