tem_getAveTimerVal Function

public function tem_getAveTimerVal(me, timerHandle, comm, nProcs) result(retValue)

Get the average of timer durations across all partitions.

Note

This assumes the same timerhandle to be used across all partitions for all timers.

Arguments

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

timer object

integer, intent(in) :: timerHandle

timer handle

integer, intent(in) :: comm

communicator handle

integer, intent(in) :: nProcs

Number of processes in the communicator.

Return Value real(kind=rk)

timer value


Calls

proc~~tem_getavetimerval~~CallsGraph proc~tem_getavetimerval tem_getAveTimerVal mpi_allreduce mpi_allreduce proc~tem_getavetimerval->mpi_allreduce proc~tem_gettimerval tem_getTimerVal proc~tem_getavetimerval->proc~tem_gettimerval proc~tem_stoptimer tem_stopTimer proc~tem_gettimerval->proc~tem_stoptimer mpi_wtime mpi_wtime proc~tem_stoptimer->mpi_wtime

Source Code

  function tem_getAveTimerVal( me, timerHandle, comm, nProcs ) result(retValue)
    ! -------------------------------------------------------------------- !
    !> timer object
    type(tem_timer_type), intent(inout), optional :: me
    !> timer handle
    integer, intent(in) :: timerHandle
    !> communicator handle
    integer, intent(in) :: comm
    !> Number of processes in the communicator.
    integer, intent(in) :: nProcs
    !> timer value
    real(kind=rk) :: retValue
    ! -------------------------------------------------------------------- !
    real(kind=rk) :: send, recv
    integer :: iError
    ! -------------------------------------------------------------------- !

    send = tem_getTimerVal( me = me, timerHandle = timerHandle )

    call MPI_Allreduce( send, recv, 1, rk_mpi, MPI_SUM, comm, iError )

    retValue = recv / nProcs

  end function tem_getAveTimerVal