Get the average of timer durations across all partitions.
Note
This assumes the same timerhandle to be used across all partitions for all timers.
Type | Intent | Optional | 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. |
timer value
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