nb_sum_reduce_complex Subroutine

private subroutine nb_sum_reduce_complex(z, dest, request)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
complex, intent(inout) :: z
integer, intent(in) :: dest
integer, intent(out) :: request

Contents

Source Code


Source Code

  subroutine nb_sum_reduce_complex (z, dest, request)
    implicit none
    complex, intent (in out) :: z
    integer, intent (in) :: dest
    integer, intent (out) :: request
# ifdef MPI3
    integer :: ierror
!$OMP MASTER
    call time_message(.false., time_mp_collectives, ' MPI Collectives')
!$OMP END MASTER
    if(iproc.eq.dest) then
       call mpi_ireduce &
            (MPI_IN_PLACE, z, 1, mpicmplx, MPI_SUM, dest, mp_comm, request, ierror)
    else
       call mpi_ireduce &
            (z, z, 1, mpicmplx, MPI_SUM, dest, mp_comm, request, ierror)
    endif
!$OMP MASTER
    call time_message(.false., time_mp_collectives, ' MPI Collectives')
!$OMP END MASTER
# else
    call sum_reduce(z, dest)
    request = mp_request_null
# endif
  end subroutine nb_sum_reduce_complex