FIXME : Add documentation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout) | :: | a | |||
integer, | intent(inout) | :: | i |
subroutine maxloc_allreduce_real(a,i)
implicit none
real, intent (in out) :: a
integer, intent (in out) :: i
# ifdef MPI
real, dimension(:,:), allocatable :: ai
integer :: ierror
allocate (ai(1,2))
ai(1,1)=a
ai(1,2)=real(i,kind=kind(a))
!$OMP MASTER
call time_message(.false., time_mp_collectives, ' MPI Collectives')
!$OMP END MASTER
call mpi_allreduce &
(MPI_IN_PLACE, ai, 1, mpi2real, MPI_MAXLOC, mp_comm, ierror)
!$OMP MASTER
call time_message(.false., time_mp_collectives, ' MPI Collectives')
!$OMP END MASTER
a=ai(1,1)
i=int(ai(1,2))
deallocate(ai)
# else
UNUSED_DUMMY(a) ; UNUSED_DUMMY(i)
# endif
end subroutine maxloc_allreduce_real