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) |
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"
path | list of names from root to selected node |
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"
path | list of names from root to selected node |
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.
path_names | list of paths (see format_path_cumulative and format_path_not_cumulative) |
append | whether to append or prepend blank lines |
|
inline |
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.
n_op | the number of operations as counted by the profiler (e.g counter.get_call_count()) |
time | time taken in seconds. |
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.
std::string molpro::profiler::detail::seconds | ( | double | time | ) |
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.
root | the node in the graph to be sorted. Will only sort that node's children. |
cumulative | whether to sort cumulatively or not. |
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 | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
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.
void molpro::profiler::detail::write_dotgraph | ( | std::string | path, |
const std::string & | dotgraph | ||
) |
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.
void molpro::profiler::detail::write_timing | ( | std::ostream & | out, |
double | time, | ||
size_t | n_op | ||
) |