Performance profiling and execution timing utilities.
Supports: - Flat timing report for all named regions. - Optional nested report based on profiler_start/profiler_stop call stack. - Runtime enable/disable via profiler_configure().
Timings are inclusive. Flat profiler rows are not additive when nested
timers are enabled. Current top-level timer names include
Transport_Update, Projection_Step, Species_Transport,
Energy_Transport, Diagnostics_Write_Flow, Diagnostics_Write_Energy,
and Output_Write_VTU; energy Cantera sync timers are
Energy_Cantera_PreSync and Energy_Cantera_PostSync.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | MAX_EDGES | = | 4096 | |
| integer, | private, | parameter | :: | MAX_STACK | = | 128 | |
| integer, | private, | parameter | :: | MAX_TIMERS | = | 512 | |
| integer, | private, | parameter | :: | NAME_LEN | = | 96 | |
| type(profiler_edge_t), | private, | save | :: | edges(MAX_EDGES) | |||
| integer, | private, | save | :: | nedges | = | 0 | |
| logical, | private, | save | :: | nested_enabled | = | .true. | |
| integer, | private, | save | :: | ntimers | = | 0 | |
| logical, | private, | save | :: | profiling_enabled | = | .true. | |
| integer, | private, | save | :: | stack_depth | = | 0 | |
| integer, | private, | save | :: | stack_ids(MAX_STACK) | = | 0 | |
| real(kind=rk), | private, | save | :: | stack_start(MAX_STACK) | = | 0.0_rk | |
| type(profiler_timer_t), | private, | save | :: | timers(MAX_TIMERS) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | calls | = | 0 | ||
| integer, | public | :: | child | = | 0 | ||
| integer, | public | :: | parent | = | 0 | ||
| real(kind=rk), | public | :: | total_time | = | 0.0_rk |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | calls | = | 0 | ||
| character(len=NAME_LEN), | public | :: | name | = | '' | ||
| real(kind=rk), | public | :: | total_time | = | 0.0_rk |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Configure profiling behavior at runtime.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(in) | :: | enabled | |||
| logical, | intent(in) | :: | nested |
Generates a collective performance report across all MPI ranks.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(MPI_Comm), | intent(in) | :: | comm | |||
| integer, | intent(in) | :: | rank | |||
| integer, | intent(in) | :: | nprocs |
Reset all profiler state.
Starts a timer for a named kernel.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Stops a timer and accumulates the elapsed time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name |
Internal utility to check MPI return codes and abort on failure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ierr |
The MPI return code. |
||
| character(len=*), | intent(in) | :: | where |
Descriptive string of where the failure occurred. |
Updates the call tree edge statistics between two timers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | parent |
Index of the calling timer. |
||
| integer, | intent(in) | :: | child |
Index of the called timer. |
||
| real(kind=rk), | intent(in) | :: | elapsed |
Wall time spent in this call. |