profiler_init Subroutine

public 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.

Arguments

Type IntentOptional Attributes Name
logical, intent(in), optional :: enabled

Source Code

   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