profiler  0.0
molpro::profiler::detail Namespace Reference

Classes

struct  TreePath
 Utility for storing a node as a path from root to that node and corresponding Counter. More...
 
struct  Compare
 
struct  AccessWall
 
struct  AccessCPU
 
struct  AccessCalls
 
struct  AccessOperations
 
struct  None
 

Functions

std::list< std::string > path_to_node (std::shared_ptr< Node< Counter >> node)
 Returns path of node names from root to node. More...
 
size_t total_operation_count (const std::shared_ptr< Node< Counter >> &node)
 Performs depth first search through the tree and accumulates operation counter value. More...
 
std::string format_path_cumulative (const std::list< std::string > &path)
 convert path to a formatted string More...
 
std::string format_path_not_cumulative (const std::list< std::string > &path)
 convert path to a formatted string More...
 
std::string format_single_path (const std::list< std::string > &path, bool cumulative)
 
template<class CompareTreePaths >
std::map< TreePath, std::shared_ptr< Node< Counter > >, CompareTreePaths > sort_children (const std::shared_ptr< Node< Counter >> &root, bool cumulative)
 Sorts the children of a node. More...
 
void format_paths (std::list< std::string > &path_names, bool append)
 Format paths for output. More...
 
std::string frequency (size_t n_op, double time)
 Get the frequency of an operation as a string with units of Hz. More...
 
std::string seconds (double time)
 
void write_timing (std::ostream &out, double time, size_t n_op)
 
void write_report (const Node< Counter > &root, const std::string &description, const std::list< TreePath > &paths, std::ostream &out, bool cumulative)
 Writes the report to an output stream. More...
 
void write_dotgraph (std::string path, const std::string &dotgraph)
 
template std::map< TreePath, std::shared_ptr< Node< Counter > >, Compare< AccessWall > > sort_children< Compare< AccessWall > > (const std::shared_ptr< Node< Counter >> &root, bool cumulative)
 
template std::map< TreePath, std::shared_ptr< Node< Counter > >, Compare< AccessCPU > > sort_children< Compare< AccessCPU > > (const std::shared_ptr< Node< Counter >> &root, bool cumulative)
 
template std::map< TreePath, std::shared_ptr< Node< Counter > >, Compare< AccessCalls > > sort_children< Compare< AccessCalls > > (const std::shared_ptr< Node< Counter >> &root, bool cumulative)
 
template std::map< TreePath, std::shared_ptr< Node< Counter > >, Compare< AccessOperations > > sort_children< Compare< AccessOperations > > (const std::shared_ptr< Node< Counter >> &root, bool cumulative)
 
template std::map< TreePath, std::shared_ptr< Node< Counter > >, Compare< None > > sort_children< Compare< None > > (const std::shared_ptr< Node< Counter >> &root, bool cumulative)
 

Function Documentation

◆ format_path_cumulative()

std::string molpro::profiler::detail::format_path_cumulative ( const std::list< std::string > &  path)

convert path to a formatted string

All parent nodes are replaced by dots {root,A,B,C} becomes "...C"

Parameters
pathlist of names from root to selected node

◆ format_path_not_cumulative()

std::string molpro::profiler::detail::format_path_not_cumulative ( const std::list< std::string > &  path)

convert path to a formatted string

Names are joined with ":" delimiter {root,A,B,C} becomes "root:A:B:C"

Parameters
pathlist of names from root to selected node

◆ format_paths()

void molpro::profiler::detail::format_paths ( std::list< std::string > &  path_names,
bool  append 
)

Format paths for output.

Appends or prepends blank lines to each path if cumulative is true or not, respectively. This ensures that all names are the same length.

Parameters
path_nameslist of paths (see format_path_cumulative and format_path_not_cumulative)
appendwhether to append or prepend blank lines

◆ format_single_path()

std::string molpro::profiler::detail::format_single_path ( const std::list< std::string > &  path,
bool  cumulative 
)
inline

◆ frequency()

std::string molpro::profiler::detail::frequency ( size_t  n_op,
double  time 
)

Get the frequency of an operation as a string with units of Hz.

Parameters
n_opthe number of operations as counted by the profiler (e.g counter.get_call_count())
timetime taken in seconds.
Returns
the frequency, as a std::string, with units of Hz.

◆ path_to_node()

std::list< std::string > molpro::profiler::detail::path_to_node ( std::shared_ptr< Node< Counter >>  node)

Returns path of node names from root to node.

◆ seconds()

std::string molpro::profiler::detail::seconds ( double  time)

◆ sort_children()

template<class CompareTreePaths >
std::map< TreePath, std::shared_ptr< Node< Counter > >, CompareTreePaths > molpro::profiler::detail::sort_children ( const std::shared_ptr< Node< Counter >> &  root,
bool  cumulative 
)

Sorts the children of a node.

Parameters
rootthe node in the graph to be sorted. Will only sort that node's children.
cumulativewhether to sort cumulatively or not.

◆ sort_children< Compare< AccessCalls > >()

template std::map<TreePath, std::shared_ptr<Node<Counter> >, Compare<AccessCalls> > molpro::profiler::detail::sort_children< Compare< AccessCalls > > ( const std::shared_ptr< Node< Counter >> &  root,
bool  cumulative 
)

◆ sort_children< Compare< AccessCPU > >()

template std::map<TreePath, std::shared_ptr<Node<Counter> >, Compare<AccessCPU> > molpro::profiler::detail::sort_children< Compare< AccessCPU > > ( const std::shared_ptr< Node< Counter >> &  root,
bool  cumulative 
)

◆ sort_children< Compare< AccessOperations > >()

template std::map<TreePath, std::shared_ptr<Node<Counter> >, Compare<AccessOperations> > molpro::profiler::detail::sort_children< Compare< AccessOperations > > ( const std::shared_ptr< Node< Counter >> &  root,
bool  cumulative 
)

◆ sort_children< Compare< AccessWall > >()

template std::map<TreePath, std::shared_ptr<Node<Counter> >, Compare<AccessWall> > molpro::profiler::detail::sort_children< Compare< AccessWall > > ( const std::shared_ptr< Node< Counter >> &  root,
bool  cumulative 
)

◆ sort_children< Compare< None > >()

template std::map<TreePath, std::shared_ptr<Node<Counter> >, Compare<None> > molpro::profiler::detail::sort_children< Compare< None > > ( const std::shared_ptr< Node< Counter >> &  root,
bool  cumulative 
)

◆ total_operation_count()

size_t molpro::profiler::detail::total_operation_count ( const std::shared_ptr< Node< Counter >> &  node)

Performs depth first search through the tree and accumulates operation counter value.

◆ write_dotgraph()

void molpro::profiler::detail::write_dotgraph ( std::string  path,
const std::string &  dotgraph 
)

◆ write_report()

void molpro::profiler::detail::write_report ( const Node< Counter > &  root,
const std::string &  description,
const std::list< TreePath > &  paths,
std::ostream &  out,
bool  cumulative 
)

Writes the report to an output stream.

◆ write_timing()

void molpro::profiler::detail::write_timing ( std::ostream &  out,
double  time,
size_t  n_op 
)