mg_timers_show Subroutine

public subroutine mg_timers_show(mg)

Uses

  • proc~~mg_timers_show~2~~UsesGraph proc~mg_timers_show~2 mg_timers_show mpi mpi proc~mg_timers_show~2->mpi

Arguments

Type IntentOptional Attributes Name
type(mg_t), intent(in) :: mg

Calls

proc~~mg_timers_show~2~~CallsGraph proc~mg_timers_show~2 mg_timers_show mpi_reduce mpi_reduce proc~mg_timers_show~2->mpi_reduce

Source Code

  subroutine mg_timers_show(mg)
    use mpi
    type(mg_t), intent(in) :: mg
    integer                :: n, ierr
    real(dp)               :: tmin(mg%n_timers)
    real(dp)               :: tmax(mg%n_timers)

    call mpi_reduce(mg%timers(1:mg%n_timers)%t, tmin, mg%n_timers, mpi_double,&
        mpi_min, 0, mg%comm, ierr)
    call mpi_reduce(mg%timers(1:mg%n_timers)%t, tmax, mg%n_timers, mpi_double,&
        mpi_max, 0, mg%comm, ierr)

    if (mg%my_rank == 0) then
       write(*, "(A20,2A16)") "name                ", "min(s)", "max(s)"
       do n = 1, mg%n_timers
          write(*, "(A20,2F16.6)") mg%timers(n)%name, tmin(n), tmax(n)
       end do
    end if
  end subroutine mg_timers_show