Commit af3b1740 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

It's a tree, dammit

parent 4a67f4de
......@@ -94,7 +94,7 @@ module ftimings
!> call timer%print()
!> \endcode
!>
!> Every first call to timer%start() at a certain point in the graph
!> Every first call to timer%start() at a certain point in the tree
!> allocates a small amount of memory. If the timer is no longer needed,
!> all that memory can be freed again with
!>
......@@ -113,7 +113,7 @@ module ftimings
logical, private :: record_virtual_memory = .false. !< IF set to .true., record also the virtual memory
logical, private :: record_max_allocated_memory = .false. !< IF set to .true., record also the max resident set size ("high water mark")
logical, private :: record_flop_count = .false. !< If set to .true., record also FLOP counts via PAPI calls
logical, private :: record_cycle_count = .false. !< If set to .true., record also CPU cycle counts via PAPI calls
logical, private :: record_cycle_count = .false. !< If set to .true., record also CPU cycle counts via PAPI calls
logical, private :: record_memory_bandwidth = .false. !< If set to .true., record also memory bandwidth via Linut perf syscalls
logical, private :: print_allocated_memory = .false.
......@@ -128,8 +128,8 @@ module ftimings
logical, private :: is_sorted = .false.
type(node_t), private, pointer :: root => NULL() !< Start of graph
type(node_t), private, pointer :: current_node => NULL() !< Current position in the graph
type(node_t), private, pointer :: root => NULL() !< Start of tree
type(node_t), private, pointer :: current_node => NULL() !< Current position in the tree
procedure(timer_error_handler_t), private, pass, pointer :: &
......@@ -179,7 +179,7 @@ module ftimings
procedure, private, pass :: resolve_node => timer_resolve_node
end type
!> Opaque type node_t, representing a graph node
!> Type node_t, representing a tree node
!>
!c> struct ftimer_node_struct;
!c> typedef struct ftimer_node_struct ftimer_node_t;
......@@ -204,7 +204,7 @@ module ftimings
procedure, private, pass :: sum_of_descendants_with_name => node_sum_of_descendants_with_name
procedure, private, pass :: sum_of_children_below => node_sum_of_children_below
procedure, private, pass :: print => node_print
procedure, private, pass :: print_graph => node_print_graph
procedure, private, pass :: print_tree => node_print_tree
procedure, private, pass :: sort_children => node_sort_children
end type
......@@ -689,7 +689,7 @@ module ftimings
!$ do i = 0, omp_get_level()
!$ write(*,*) "omp_get_ancestor_thread_num(", i, ") = ", omp_get_ancestor_thread_num(i)
!$ end do
call self%root%print_graph(0)
call self%root%print_tree(0)
!$omp end critical
#endif
call self%error("timer_start() while same timer was active")
......@@ -853,7 +853,7 @@ module ftimings
end function
!> Print a timing graph
!> Print a timing tree
!>
!> \param name1 If given, first descend one level to the node with name name1
!> \param name2 If given, also descend another level to the node with name2 there
......@@ -994,7 +994,7 @@ module ftimings
write(unit_act,'(a)') ""
call node%print_graph(0, threshold, is_sorted=self%is_sorted, unit=unit)
call node%print_tree(0, threshold, is_sorted=self%is_sorted, unit=unit)
end subroutine
......@@ -1070,8 +1070,8 @@ module ftimings
end function
!> Access a specific, already stopped entry of the graph by specifying the
!> names of the nodes along the graph from the root node
!> Access a specific, already stopped entry of the tree by specifying the
!> names of the nodes along the tree from the root node
!>
!> The result is only meaningfull if the entry was never appended by
!> additional %start() calls.
......@@ -1124,8 +1124,8 @@ module ftimings
s = real(node%value%micros, kind=rk) * 1e-6_rk
end function
!> Access a specific, already stopped entry of the graph by specifying the
!> names of the nodes along the graph from the root node
!> Access a specific, already stopped entry of the tree by specifying the
!> names of the nodes along the tree from the root node
!>
!> The result is only meaningfull if the entry was never appended by
!> additional %start() calls.
......@@ -1252,8 +1252,8 @@ module ftimings
v = node%value - node%sum_of_children()
end function
!> Access a specific, not yet stopped entry of the graph by specifying the
!> names of the nodes along the graph from the root node and return the
!> Access a specific, not yet stopped entry of the tree by specifying the
!> names of the nodes along the tree from the root node and return the
!> seconds that have passed since the entry was created.
!>
!> The result is only meaningfull if the entry was never appended by
......@@ -1302,7 +1302,7 @@ module ftimings
end function
!> Sort the graph on each level.
!> Sort the tree on each level.
!> Warning: This irrevocable destroys the old ordering.
!>
subroutine timer_sort(self)
......@@ -1599,7 +1599,7 @@ module ftimings
call print_value(val, self%timer, indent_level, name, total, unit)
end subroutine
recursive subroutine node_print_graph(self, indent_level, threshold, is_sorted, total, unit)
recursive subroutine node_print_tree(self, indent_level, threshold, is_sorted, total, unit)
use, intrinsic :: iso_fortran_env, only : output_unit
class(node_t), intent(inout) :: self
integer, intent(in) :: indent_level
......@@ -1690,7 +1690,7 @@ module ftimings
if (node_value%micros * 1e-6_rk >= threshold_act &
.or. associated(node, threshold_node) &
.or. associated(node, own_node)) then
call node%print_graph(indent_level + 1, threshold, is_sorted, cur_value, unit_act)
call node%print_tree(indent_level + 1, threshold, is_sorted, cur_value, unit_act)
endif
node => node%nextSibling
end do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment