tem_stopTimer Subroutine

public subroutine tem_stopTimer(me, timerHandle)

Stop the timer for the given timer handle and update the timings

Arguments

Type IntentOptional Attributes Name
type(tem_timer_type), intent(inout), optional :: me

timer object

integer, intent(in) :: timerHandle

Handle of the timer to stop


Calls

proc~~tem_stoptimer~~CallsGraph proc~tem_stoptimer tem_stopTimer mpi_wtime mpi_wtime proc~tem_stoptimer->mpi_wtime

Called by

proc~~tem_stoptimer~~CalledByGraph proc~tem_stoptimer tem_stopTimer proc~tem_gettimerval tem_getTimerVal proc~tem_gettimerval->proc~tem_stoptimer proc~tem_simcontrol_syncupdate tem_simControl_syncUpdate proc~tem_simcontrol_syncupdate->proc~tem_stoptimer proc~tem_finalize tem_finalize proc~tem_finalize->proc~tem_gettimerval proc~tem_getavetimerval tem_getAveTimerVal proc~tem_getavetimerval->proc~tem_gettimerval proc~tem_getmaxtimerval tem_getMaxTimerVal proc~tem_getmaxtimerval->proc~tem_gettimerval proc~tem_getmintimerval tem_getMinTimerVal proc~tem_getmintimerval->proc~tem_gettimerval proc~tem_getsumtimerval tem_getSumTimerVal proc~tem_getsumtimerval->proc~tem_gettimerval proc~tem_timer_dumplabeled tem_timer_dumplabeled proc~tem_timer_dumplabeled->proc~tem_getmaxtimerval proc~tem_timer_dumplabeled->proc~tem_getmintimerval proc~tem_timer_dumplabeled->proc~tem_getsumtimerval proc~tem_timer_dump_glob tem_timer_dump_glob proc~tem_timer_dump_glob->proc~tem_timer_dumplabeled

Source Code

  subroutine tem_stopTimer( me, timerHandle )
    ! -------------------------------------------------------------------- !
    !> timer object
    type(tem_timer_type), intent(inout), optional :: me
    !> Handle of the timer to stop
    integer, intent(in) :: timerHandle
    ! -------------------------------------------------------------------- !
    real(kind=rk) :: endTime
    ! -------------------------------------------------------------------- !

    endTime = mpi_wtime()

    if ( present(me) ) then
      if ( me%running%val(timerHandle) ) then
        me%running%val(timerHandle) = .false.
        me%duration%val(timerHandle) = me%duration%val(timerHandle) &
          &                            + endTime                    &
          &                            - me%tStart%val(timerHandle)
      end if
    else
      if ( timer%timedat%running%val(timerHandle) ) then
        timer%timedat%running%val(timerHandle) = .false.
        timer%timedat%duration%val(timerHandle) &
          &  = timer%timedat%duration%val(timerHandle) &
          &    + endTime                               &
          &    - timer%timedat%tStart%val(timerHandle)
      end if
    end if

  end subroutine tem_stopTimer