profiler_start Subroutine

public subroutine profiler_start(name, nvtx_only)

Start a named profiling region If nvtx_only is true, the region only appears in NVTX timeline, not in text report

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name
logical, intent(in), optional :: nvtx_only

Calls

proc~~profiler_start~~CallsGraph proc~profiler_start profiler_start proc~find_or_create_region find_or_create_region proc~profiler_start->proc~find_or_create_region proc~get_wall_time get_wall_time proc~profiler_start->proc~get_wall_time proc~nvtx_range_push nvtx_range_push proc~profiler_start->proc~nvtx_range_push

Called by

proc~~profiler_start~~CalledByGraph proc~profiler_start profiler_start proc~barotropic_substep_nonlinear barotropic_substep_nonlinear proc~barotropic_substep_nonlinear->proc~profiler_start proc~bt_wide_entry_exchange_impl bt_wide_entry_exchange_impl proc~bt_wide_entry_exchange_impl->proc~profiler_start proc~continuity_gm_apply continuity_gm_apply proc~continuity_gm_apply->proc~profiler_start proc~continuity_tracer_step_split continuity_tracer_step_split proc~continuity_tracer_step_split->proc~profiler_start proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~profiler_start proc~engine_step engine_step proc~driver_run_ocean->proc~engine_step proc~engine_step_ice engine_step_ice proc~driver_run_ocean->proc~engine_step_ice proc~engine_enter_data engine_enter_data proc~driver_run_ocean->proc~engine_enter_data proc~engine_exit_data engine_exit_data proc~driver_run_ocean->proc~engine_exit_data proc~engine_setup engine_setup proc~driver_run_ocean->proc~engine_setup proc~engine_step->proc~profiler_start proc~ocean_dyn_step_split ocean_dyn_step_split proc~engine_step->proc~ocean_dyn_step_split proc~ocean_data_forcing_apply ocean_data_forcing_apply proc~engine_step->proc~ocean_data_forcing_apply proc~ocean_dyn_step ocean_dyn_step proc~engine_step->proc~ocean_dyn_step proc~engine_step_ice->proc~profiler_start proc~ocean_halo_exchange_ice_fluxes ocean_halo_exchange_ice_fluxes proc~engine_step_ice->proc~ocean_halo_exchange_ice_fluxes proc~ocean_halo_exchange_ice_state ocean_halo_exchange_ice_state proc~engine_step_ice->proc~ocean_halo_exchange_ice_state proc~ice_ocean_stress_flux ice_ocean_stress_flux proc~engine_step_ice->proc~ice_ocean_stress_flux proc~ice_transport_step ice_transport_step proc~engine_step_ice->proc~ice_transport_step proc~ocean_dyn_step_split->proc~profiler_start proc~run_gm_step run_gm_step proc~ocean_dyn_step_split->proc~run_gm_step proc~run_stage_split run_stage_split proc~ocean_dyn_step_split->proc~run_stage_split proc~ocean_halo_exchange_ice_fluxes->proc~profiler_start proc~ocean_halo_exchange_ice_state->proc~profiler_start proc~ocean_halo_exchange_ice_transport ocean_halo_exchange_ice_transport proc~ocean_halo_exchange_ice_transport->proc~profiler_start proc~ocean_halo_exchange_ml_state ocean_halo_exchange_ml_state proc~ocean_halo_exchange_ml_state->proc~profiler_start proc~ocean_seam_refresh_surface_stress ocean_seam_refresh_surface_stress proc~ocean_seam_refresh_surface_stress->proc~profiler_start proc~ocean_state_enter_data ocean_state_enter_data proc~ocean_state_enter_data->proc~profiler_start proc~ocean_state_exit_data ocean_state_exit_data proc~ocean_state_exit_data->proc~profiler_start proc~refresh_tracer_ghosts refresh_tracer_ghosts proc~refresh_tracer_ghosts->proc~profiler_start proc~run_continuity_chain run_continuity_chain proc~run_continuity_chain->proc~profiler_start proc~run_continuity_chain->proc~continuity_tracer_step_split proc~run_continuity_chain->proc~ocean_halo_exchange_ml_state proc~run_continuity_chain->proc~refresh_tracer_ghosts proc~run_gm_step->proc~profiler_start proc~run_gm_step->proc~continuity_gm_apply proc~run_gm_step->proc~ocean_halo_exchange_ml_state proc~run_stage_split->proc~profiler_start proc~run_stage_split->proc~ocean_halo_exchange_ml_state proc~run_stage_split->proc~refresh_tracer_ghosts proc~run_stage_split->proc~run_continuity_chain proc~vmix_apply_in_stage vmix_apply_in_stage proc~run_stage_split->proc~vmix_apply_in_stage proc~barotropic_substep_nonlinear_interior barotropic_substep_nonlinear_interior proc~run_stage_split->proc~barotropic_substep_nonlinear_interior proc~bt_wide_entry_exchange bt_wide_t%bt_wide_entry_exchange proc~run_stage_split->proc~bt_wide_entry_exchange proc~bt_wide_substep bt_wide_substep proc~run_stage_split->proc~bt_wide_substep proc~vmix_apply_in_stage->proc~profiler_start proc~barotropic_substep_nonlinear_interior->proc~barotropic_substep_nonlinear proc~bt_wide_entry_exchange->proc~bt_wide_entry_exchange_impl proc~bt_wide_substep->proc~barotropic_substep_nonlinear proc~configure_ocean_forcing configure_ocean_forcing proc~configure_ocean_forcing->proc~ocean_seam_refresh_surface_stress proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~engine_enter_data->proc~ocean_halo_exchange_ml_state proc~engine_enter_data->proc~ocean_state_enter_data proc~engine_exit_data->proc~ocean_state_exit_data proc~engine_setup->proc~ocean_halo_exchange_ice_state proc~engine_setup->proc~ocean_halo_exchange_ml_state proc~engine_setup->proc~configure_ocean_forcing proc~ocean_data_forcing_configure ocean_data_forcing_configure proc~engine_setup->proc~ocean_data_forcing_configure proc~ice_ocean_stress_flux->proc~ocean_seam_refresh_surface_stress proc~ice_transport_step->proc~ocean_halo_exchange_ice_transport proc~ocean_data_forcing_apply->proc~ocean_seam_refresh_surface_stress proc~ocean_data_forcing_configure->proc~ocean_seam_refresh_surface_stress proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step proc~rdb_ocean_step->proc~engine_step_ice proc~run_stage run_stage proc~run_stage->proc~continuity_tracer_step_split proc~run_stage->proc~vmix_apply_in_stage proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_enter_data proc~complete_ocean_create->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~ocean_dyn_step->proc~run_stage proc~rdb_ocean_destroy rdb_ocean_destroy proc~rdb_ocean_destroy->proc~engine_exit_data proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
integer, private :: idx

Source Code

   subroutine profiler_start(name, nvtx_only)
      !! Start a named profiling region
      !! If nvtx_only is true, the region only appears in NVTX timeline, not in text report
      character(len=*), intent(in) :: name
      logical, intent(in), optional :: nvtx_only
      integer :: idx

#ifdef DISABLE_PROFILER
      return
#endif

      if (.not. state%enabled) return

      idx = find_or_create_region(name)
      if (idx < 0) return

      if (state%regions(idx)%active) return

      if (present(nvtx_only) .and. state%regions(idx)%call_count == 0) then
         state%regions(idx)%nvtx_only = nvtx_only
      end if

      state%regions(idx)%active = .true.
      call nvtx_range_push(name)
      state%regions(idx)%start_time = get_wall_time()
   end subroutine profiler_start