timer_obj_AddTiming Subroutine

private pure subroutine timer_obj_AddTiming(this, name)

Adds timing info.

Type Bound

timer_obj

Arguments

Type IntentOptional Attributes Name
class(timer_obj), intent(inout) :: this

Timer

character(len=*), intent(in) :: name

Name of timing data


Calls

proc~~timer_obj_addtiming~~CallsGraph proc~timer_obj_addtiming timer_obj%timer_obj_AddTiming proc~hashtbl_obj_hashstring hashtbl_obj%hashtbl_obj_HashString proc~timer_obj_addtiming->proc~hashtbl_obj_hashstring proc~hashtbl_obj_put hashtbl_obj%hashtbl_obj_Put proc~timer_obj_addtiming->proc~hashtbl_obj_put proc~sllist_obj_put sllist_obj%sllist_obj_Put proc~hashtbl_obj_put->proc~sllist_obj_put proc~sllist_obj_put->proc~sllist_obj_put

Called by

proc~~timer_obj_addtiming~~CalledByGraph proc~timer_obj_addtiming timer_obj%timer_obj_AddTiming proc~cdifs_obj_preparesolvermonitor cdifs_obj_PrepareSolverMonitor proc~cdifs_obj_preparesolvermonitor->proc~timer_obj_addtiming proc~grans_obj_preparesolvermonitor grans_obj_PrepareSolverMonitor proc~grans_obj_preparesolvermonitor->proc~timer_obj_addtiming proc~cdifs_obj_preparesolver cdifs_obj_PrepareSolver proc~cdifs_obj_preparesolver->proc~cdifs_obj_preparesolvermonitor proc~grans_obj_preparesolver grans_obj_PrepareSolver proc~grans_obj_preparesolver->proc~grans_obj_preparesolvermonitor interface~cdifs_obj_preparesolver cdifs_obj%cdifs_obj_PrepareSolver interface~cdifs_obj_preparesolver->proc~cdifs_obj_preparesolver interface~grans_obj_preparesolver grans_obj%grans_obj_PrepareSolver interface~grans_obj_preparesolver->proc~grans_obj_preparesolver

Source Code

    pure subroutine timer_obj_AddTiming(this,name)
      !> Adds timing info.
      implicit none
      class(timer_obj), intent(inout) :: this                                  !! Timer
      character(len=*), intent(in)    :: name                                  !! Name of timing data
      ! Work bariables
      real(wp), allocatable :: tmp_array(:)
      integer               :: idx

      ! Expand timing array to add a new element
      if (.not.allocated(this%timing)) then
        allocate(this%timing(1))
      else
        ! Allocate temporary array
        allocate(tmp_array(size(this%timing)+1))

        ! Store old values
        tmp_array(1:size(this%timing)) = this%timing(:)

        ! Move the allocation from the
        ! temporary array to the final one
        call move_alloc(tmp_array,this%timing)
      end if

      ! Add to hash table
      idx = size(this%timing)
      call this%tbl%Put(key=this%tbl%HashString(name),val=idx)

      ! Set initial timing to zero
      this%timing(idx) = this%itertime

      return
    end subroutine timer_obj_AddTiming