profiler_stop Subroutine

public subroutine profiler_stop(name)

Stops a timer and accumulates the elapsed time.

Arguments

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

Calls

proc~~profiler_stop~~CallsGraph proc~profiler_stop mod_profiler::profiler_stop mpi_wtime mpi_wtime proc~profiler_stop->mpi_wtime proc~find_or_create_timer mod_profiler::find_or_create_timer proc~profiler_stop->proc~find_or_create_timer proc~record_edge mod_profiler::record_edge proc~profiler_stop->proc~record_edge

Called by

proc~~profiler_stop~~CalledByGraph proc~profiler_stop mod_profiler::profiler_stop proc~advance_energy_transport mod_energy::advance_energy_transport proc~advance_energy_transport->proc~profiler_stop proc~flow_exchange_cell_scalar mod_mpi_flow::flow_exchange_cell_scalar proc~advance_energy_transport->proc~flow_exchange_cell_scalar proc~advance_projection_step mod_flow_projection::advance_projection_step proc~advance_projection_step->proc~profiler_stop proc~balance_neumann_outlet_flux mod_flow_projection::balance_neumann_outlet_flux proc~advance_projection_step->proc~balance_neumann_outlet_flux proc~flow_exchange_cell_matrix mod_mpi_flow::flow_exchange_cell_matrix proc~advance_projection_step->proc~flow_exchange_cell_matrix proc~advance_projection_step->proc~flow_exchange_cell_scalar proc~flow_exchange_face_scalar mod_mpi_flow::flow_exchange_face_scalar proc~advance_projection_step->proc~flow_exchange_face_scalar proc~compute_flow_diagnostics mod_flow_projection::compute_flow_diagnostics proc~advance_projection_step->proc~compute_flow_diagnostics proc~solve_pressure_correction mod_flow_projection::solve_pressure_correction proc~advance_projection_step->proc~solve_pressure_correction proc~balance_neumann_outlet_flux->proc~profiler_stop proc~flow_allgather_owned_matrix mod_mpi_flow::flow_allgather_owned_matrix proc~flow_allgather_owned_matrix->proc~profiler_stop proc~flow_allgather_owned_matrix_inplace mod_mpi_flow::flow_allgather_owned_matrix_inplace proc~flow_allgather_owned_matrix_inplace->proc~profiler_stop proc~flow_allgather_owned_scalar mod_mpi_flow::flow_allgather_owned_scalar proc~flow_allgather_owned_scalar->proc~profiler_stop proc~flow_allgather_owned_v4 mod_mpi_flow::flow_allgather_owned_v4 proc~flow_allgather_owned_v4->proc~profiler_stop proc~flow_allreduce_global_scalar mod_mpi_flow::flow_allreduce_global_scalar proc~flow_allreduce_global_scalar->proc~profiler_stop proc~flow_allreduce_global_vector mod_mpi_flow::flow_allreduce_global_vector proc~flow_allreduce_global_vector->proc~profiler_stop proc~flow_exchange_cell_matrix->proc~profiler_stop proc~flow_exchange_cell_scalar->proc~profiler_stop proc~flow_exchange_face_scalar->proc~profiler_stop proc~flow_gather_owned_matrix_root mod_mpi_flow::flow_gather_owned_matrix_root proc~flow_gather_owned_matrix_root->proc~profiler_stop proc~flow_gather_owned_scalar_root mod_mpi_flow::flow_gather_owned_scalar_root proc~flow_gather_owned_scalar_root->proc~profiler_stop proc~flow_global_dot_owned mod_mpi_flow::flow_global_dot_owned proc~flow_global_dot_owned->proc~profiler_stop proc~flow_global_dots_owned mod_mpi_flow::flow_global_dots_owned proc~flow_global_dots_owned->proc~profiler_stop proc~flow_global_max_owned mod_mpi_flow::flow_global_max_owned proc~flow_global_max_owned->proc~profiler_stop proc~flow_global_sum_owned mod_mpi_flow::flow_global_sum_owned proc~flow_global_sum_owned->proc~profiler_stop proc~flow_global_two_dots_owned mod_mpi_flow::flow_global_two_dots_owned proc~flow_global_two_dots_owned->proc~profiler_stop proc~pressure_matvec mod_flow_projection::pressure_matvec proc~pressure_matvec->proc~profiler_stop proc~update_transport_properties mod_transport_properties::update_transport_properties proc~update_transport_properties->proc~profiler_stop proc~update_transport_properties->proc~flow_exchange_cell_matrix proc~update_transport_properties->proc~flow_exchange_cell_scalar program~lowmach_react_hex lowmach_react_hex program~lowmach_react_hex->proc~profiler_stop program~lowmach_react_hex->proc~advance_energy_transport program~lowmach_react_hex->proc~advance_projection_step program~lowmach_react_hex->proc~update_transport_properties proc~advance_species_transport mod_species::advance_species_transport program~lowmach_react_hex->proc~advance_species_transport program~lowmach_react_hex->proc~compute_flow_diagnostics proc~advance_species_transport->proc~flow_exchange_cell_matrix proc~compute_flow_diagnostics->proc~flow_global_max_owned proc~flow_allgather_owned_vector mod_mpi_flow::flow_allgather_owned_vector proc~flow_allgather_owned_vector->proc~flow_allgather_owned_matrix proc~solve_pressure_correction->proc~flow_exchange_cell_scalar proc~solve_pressure_correction->proc~flow_global_dot_owned proc~solve_pressure_correction->proc~flow_global_two_dots_owned proc~solve_pressure_correction->proc~pressure_matvec

Source Code

   subroutine profiler_stop(name)
      character(len=*), intent(in) :: name
      integer :: idx, parent
      real(rk) :: elapsed

      if (.not. profiling_enabled) return

      if (stack_depth <= 0) then
         write(error_unit,'(a,a)') 'profiler: stop with empty stack: ', trim(name)
         error stop 1
      end if

      idx = find_or_create_timer(name)

      if (stack_ids(stack_depth) /= idx) then
         write(error_unit,'(a)') 'profiler: mismatched profiler_stop'
         write(error_unit,'(a,a)') '  expected: ', trim(timers(stack_ids(stack_depth))%name)
         write(error_unit,'(a,a)') '  got:      ', trim(name)
         error stop 1
      end if

      elapsed = real(MPI_Wtime(), rk) - stack_start(stack_depth)

      timers(idx)%total_time = timers(idx)%total_time + elapsed
      timers(idx)%calls = timers(idx)%calls + 1

      if (nested_enabled) then
         if (stack_depth > 1) then
            parent = stack_ids(stack_depth - 1)
         else
            parent = 0
         end if
         call record_edge(parent, idx, elapsed)
      end if

      stack_ids(stack_depth) = 0
      stack_start(stack_depth) = 0.0_rk
      stack_depth = stack_depth - 1
   end subroutine profiler_stop