min_reduce_integer Subroutine

private subroutine min_reduce_integer(i, dest)

FIXME : Add documentation

Arguments

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

Contents

Source Code


Source Code

  subroutine min_reduce_integer (i, dest)
    implicit none
    integer, intent (in out) :: i
    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, i, 1, MPI_INTEGER, MPI_MIN, dest, mp_comm, ierror)
    else
       call mpi_reduce &
            (i, i, 1, MPI_INTEGER, MPI_MIN, dest, mp_comm, ierror)
    endif
!$OMP MASTER
    call time_message(.false., time_mp_collectives, ' MPI Collectives')
!$OMP END MASTER
# else
    if (dest /= 0) call mp_abort ("reduce to")
# endif
  end subroutine min_reduce_integer