Class representing the call stack entry
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | private, | allocatable | :: | name | Name of the entry (procedure) |
||
type(mimic_stack_entry), | private, | dimension(:), pointer | :: | children | => | null() | Nested entries (internal calls) |
type(mimic_stack_entry), | private, | pointer | :: | parent | => | null() | Pointer to the parent entry |
integer, | private | :: | num_children | = | 0 | Number of nested entries |
|
real(kind=dp), | private, | dimension(:), allocatable | :: | start_times | Array of times of start of the procedure |
||
real(kind=dp), | private, | dimension(:), allocatable | :: | end_times | Array of times of finish of the procedure |
||
integer, | private | :: | num_calls | Total number of calls |
|||
integer, | private | :: | hash | Hash identifier |
Initializer of a stack entry
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | name | Name of a function |
||
integer, | intent(in) | :: | hash | Hash ID |
||
integer, | intent(in) | :: | num_calls | Current number of calls |
||
type(mimic_stack_entry), | pointer | :: | parent | Parent entry |
Add new start time to the entry
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mimic_stack_entry), | intent(inout) | :: | this |
Recursive function printing timing of the entry and its children
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mimic_stack_entry), | intent(inout) | :: | this | |||
integer, | intent(in) | :: | level |
type :: mimic_stack_entry
private
!> Name of the entry (procedure)
character(len=:), allocatable :: name
!> Nested entries (internal calls)
type(mimic_stack_entry), dimension(:), pointer :: children => null()
!> Pointer to the parent entry
type(mimic_stack_entry), pointer :: parent => null()
!> Number of nested entries
integer :: num_children = 0
!> Array of times of start of the procedure
real(dp), dimension(:), allocatable :: start_times
!> Array of times of finish of the procedure
real(dp), dimension(:), allocatable :: end_times
!> Total number of calls
integer :: num_calls
!> Hash identifier
integer :: hash
contains
procedure :: increment => increment_entry
procedure :: print => print_entry
end type mimic_stack_entry