Initialize the profiler
Must be called before any profiling regions are started. Optionally pass enabled=.false. to start with profiling disabled.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(in), | optional | :: | enabled |
subroutine profiler_init(enabled) !! Initialize the profiler !! !! Must be called before any profiling regions are started. !! Optionally pass enabled=.false. to start with profiling disabled. logical, intent(in), optional :: enabled #ifdef PIC_DISABLE_PROFILER return #endif state%initialized = .true. state%enabled = .true. if (present(enabled)) state%enabled = enabled state%num_regions = 0 state%stack_depth = 0 end subroutine profiler_init