Namespaces | |
detail | |
dotgraph | |
Classes | |
class | Node |
A node in a parameter tree storing a Counter object aliased by a name. More... | |
class | Profiler |
Instrumental profiler for timing sections of code. More... | |
class | Timer |
Measures cpu or wall time. Can be constructed as a dummy that is always stopped. More... | |
class | Counter |
Resource counter used for storing operation count, call count, timing information. More... | |
struct | NodePathError |
struct | WeakSingleton |
Implements the mechanism for the weak singleton pattern. More... | |
Enumerations | |
enum class | SortBy { wall , cpu , calls , operations , none } |
Functions | |
void | report (const std::shared_ptr< Node< Counter >> &root, const std::string &description, std::ostream &out, bool cumulative=true, SortBy sort_by=SortBy::wall) |
Reports the content of a Profiler call subtree. More... | |
void | report (const Profiler &prof, std::ostream &out, bool cumulative=true, SortBy sort_by=SortBy::wall) |
Reports content of Profiler. More... | |
std::string | get_dotgraph (const Profiler &prof, int hot[3], int cool[3], double threshold, bool get_percentage_time) |
std::ostream & | operator<< (std::ostream &os, const Profiler &obj) |
MPI_Comm | comm_self () |
Return MPI_COMM_SELF in an MPI program, or an appropriate dummy if not. More... | |
MPI_Comm | comm_global () |
Return the MPI communicator containing all processes available for participation in computation. If MPI support has been compiled (either mpi.h has already been included, or HAVE_MPI_H has been defined) but not yet initialised, MPI will be initialised, and then MPI_COMM_WORLD is selected. Otherwise, in the case of a program compiled with PPIDD, and for which PPIDD has already been initialised, this will be the PPIDD worker communicator. Otherwise, in the case of a program compiled with GA, and for which GA has already been initialised, this will be the GA worker communicator. Otherwise, if MPI support has is active, MPI_COMM_WORLD is selected. Otherwise (completely serial code), a place-holder is chosen. More... | |
int | size_global () |
int | rank_global () |
int | init () |
In MPI environment initialize; otherwise do nothing. Intended to support MPI-agnostic programs. More... | |
int | finalize () |
In MPI environment finalize; otherwise do nothing. More... | |
Variables | |
std::shared_ptr< Profiler > | s_saver |
|
strong |
|
inline |
Return the MPI communicator containing all processes available for participation in computation. If MPI support has been compiled (either mpi.h has already been included, or HAVE_MPI_H has been defined) but not yet initialised, MPI will be initialised, and then MPI_COMM_WORLD is selected. Otherwise, in the case of a program compiled with PPIDD, and for which PPIDD has already been initialised, this will be the PPIDD worker communicator. Otherwise, in the case of a program compiled with GA, and for which GA has already been initialised, this will be the GA worker communicator. Otherwise, if MPI support has is active, MPI_COMM_WORLD is selected. Otherwise (completely serial code), a place-holder is chosen.
|
inline |
Return MPI_COMM_SELF in an MPI program, or an appropriate dummy if not.
int molpro::profiler::finalize | ( | ) |
In MPI environment finalize; otherwise do nothing.
std::string molpro::profiler::get_dotgraph | ( | const Profiler & | prof, |
int | hot[3], | ||
int | cool[3], | ||
double | threshold, | ||
bool | get_percentage_time | ||
) |
int molpro::profiler::init | ( | ) |
In MPI environment initialize; otherwise do nothing. Intended to support MPI-agnostic programs.
std::ostream& molpro::profiler::operator<< | ( | std::ostream & | os, |
const Profiler & | obj | ||
) |
|
inline |
void molpro::profiler::report | ( | const Profiler & | prof, |
std::ostream & | out, | ||
bool | cumulative = true , |
||
SortBy | sort_by = SortBy::wall |
||
) |
Reports content of Profiler.
prof | profiler to analyse and write |
out | output stream to write to |
sort_by | what parameter to use for sorting. Sorting is done on the same level only. |
cumulative | whether cumulative timings should be used or only time spend by the node and not its children |
void molpro::profiler::report | ( | const std::shared_ptr< Node< Counter >> & | root, |
const std::string & | description, | ||
std::ostream & | out, | ||
bool | cumulative = true , |
||
SortBy | sort_by = SortBy::wall |
||
) |
Reports the content of a Profiler call subtree.
In case only part of the call tree needs to be reported. You can use Node<Counter>::find_parent, Node<Counter::walk, Node<Counter::child and Node<Counter::walk_up to navigate to the desired node.
Example usage
root | root node of the tree, can be different from Profiler::root |
description | description to use for profiler |
out | output stream to write to |
cumulative | whether cumulative timings should be used or only time spend by the node and not its children |
sort_by | what parameter to use for sorting. Sorting is done on the same level only. |
|
inline |
std::shared_ptr<Profiler> molpro::profiler::s_saver |