max_reduce_real Subroutine

private subroutine max_reduce_real(a, dest)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(inout) :: a
integer, intent(in) :: dest

Contents

Source Code


Source Code

  subroutine max_reduce_real (a, dest)
    implicit none
    real, intent (in out) :: a
    integer, intent (in) :: dest
# ifdef MPI
    integer :: ierror
!$OMP MASTER
    call time_message(.false., time_mp_collectives, ' MPI Collectives')
!$OMP END MASTER
    if(iproc.eq.dest)then
       call mpi_reduce &
            (MPI_IN_PLACE, a, 1, mpireal, MPI_MAX, dest, mp_comm, ierror)
    else
       call mpi_reduce &
            (a, a, 1, mpireal, MPI_MAX, dest, mp_comm, ierror)
    endif
!$OMP MASTER
    call time_message(.false., time_mp_collectives, ' MPI Collectives')
!$OMP END MASTER
# else
    UNUSED_DUMMY(a)
    if (dest /= 0) call mp_abort ("reduce to")
# endif
  end subroutine max_reduce_real