1 #ifndef PROFILER_SRC_MOLPRO_PROFILER_DOTGRAPH
2 #define PROFILER_SRC_MOLPRO_PROFILER_DOTGRAPH
8 #include <molpro/profiler/Counter.h>
9 #include <molpro/profiler/Node.h>
10 #include <molpro/profiler/report.h>
34 std::pair<std::string, std::string>
get_colours(
int hot[3],
int cool[3],
double total_time);
48 std::string
blend_colours(
double ratio,
int hot_colour[3],
int cool_colour[3]);
57 std::string
print_time(
double time,
double total_time,
bool show_percentage_time);
71 std::string
make_box(std::string name,
double time,
double total_time,
size_t call_count,
size_t opcount,
72 int hot[3],
int cool[3],
bool show_percentage_time);
86 std::string
make_arrow(std::string name_from, std::string name_to,
double time,
double total_time,
size_t call_count,
87 int hot[3],
int cool[3],
bool show_percentage_time);
104 void merge_vec(std::vector<GraphEntry>& graph_entries);
113 void apply_threshold(std::vector<GraphEntry>& graph_entries,
double threshold,
double total_time);
140 std::string
get_graph_markup(std::vector<GraphEntry>& graph_entries,
double total_time,
int hot[3],
int cool[3],
141 bool show_percentage_time);
154 std::vector<GraphEntry>& graph_entries);
169 double threshold,
bool show_percentage_time);
A node in a parameter tree storing a Counter object aliased by a name.
Definition: Node.h:20
Definition: dotgraph.h:19
int operations
Definition: dotgraph.h:29
std::string fontcolour
Definition: dotgraph.h:28
std::pair< std::string, std::string > get_colours(int hot[3], int cool[3], double total_time)
int calls
Definition: dotgraph.h:26
double runtime
Definition: dotgraph.h:25
std::string name
Definition: dotgraph.h:24
std::string name_to
Definition: dotgraph.h:27
GraphEntry(EntryType entry_type, std::string name, double runtime, int calls, double total_time, int operations=-1, std::string name_to="")
Definition: dotgraph.cpp:164
EntryType entry_type
Definition: dotgraph.h:23
std::string make_arrow(std::string name_from, std::string name_to, double time, double total_time, size_t call_count, int hot[3], int cool[3], bool show_percentage_time)
Create a graphviz arrow of a profiler node.
Definition: dotgraph.cpp:49
std::string make_dotgraph(std::shared_ptr< Node< Counter >> root, double total_time, int hot[3], int cool[3], double threshold, bool show_percentage_time)
This creates the complete graphviz markup for the whole performance graph, including global styles....
Definition: dotgraph.cpp:172
bool has_parent(GraphEntry &child, std::vector< GraphEntry > &graph_entries)
Determines if a node has a parent.
Definition: dotgraph.cpp:139
void apply_threshold(std::vector< GraphEntry > &graph_entries, double threshold, double total_time)
This removes any enntry from graph_entries with a runtime/total_time less than threshold.
Definition: dotgraph.cpp:127
void combine_graph_entries(GraphEntry &entry1, GraphEntry &entry2)
Combines two graph entries, summing their time, calls and opcount.
Definition: dotgraph.cpp:76
EntryType
Definition: dotgraph.h:16
@ edge
Definition: dotgraph.h:16
@ node
Definition: dotgraph.h:16
std::string print_time(double time, double total_time, bool show_percentage_time)
Returns a string with the runtime of a node.
Definition: dotgraph.cpp:26
std::string make_box(std::string name, double time, double total_time, size_t call_count, size_t opcount, int hot[3], int cool[3], bool show_percentage_time)
Create a graphviz box of a profiler node.
Definition: dotgraph.cpp:36
void destroy_orphans(std::vector< GraphEntry > &graph_entries)
Removes every element from graph_entries that does not have an edge pointing towards it (unless it's ...
Definition: dotgraph.cpp:151
std::string blend_colours(double ratio, int hot_colour[3], int cool_colour[3])
Simple additive blending of two colours. May be reduced with nicer colour blending in the future.
Definition: dotgraph.cpp:12
void make_dotgraph_vec(std::shared_ptr< Node< Counter >> root, double total_time, std::vector< GraphEntry > &graph_entries)
This populates a vector containing a GraphEntry for each profiler node. This is an intermediate data ...
Definition: dotgraph.cpp:85
std::string get_graph_markup(std::vector< GraphEntry > &graph_entries, double total_time, int hot[3], int cool[3], bool show_percentage_time)
This gets the graphviz markup for the main part of the graph (excepting global styles).
Definition: dotgraph.cpp:58
void merge_vec(std::vector< GraphEntry > &graph_entries)
Iterates through the list of GraphEntries and merges any two nodes with the same name....
Definition: dotgraph.cpp:104