allreduce_dp_array_to Subroutine

private subroutine allreduce_dp_array_to(comm, sendbuf, recvbuf, count, op)

Arguments

Type IntentOptional Attributes Name
type(comm_t), intent(in) :: comm
real(kind=dp), intent(in) :: sendbuf(:)
real(kind=dp), intent(out) :: recvbuf(:)
integer, intent(in), optional :: count
integer, intent(in), optional :: op

Calls

proc~~allreduce_dp_array_to~2~~CallsGraph proc~allreduce_dp_array_to~2 allreduce_dp_array_to mpi_allreduce mpi_allreduce proc~allreduce_dp_array_to~2->mpi_allreduce proc~comm_get~2 comm_t%comm_get proc~allreduce_dp_array_to~2->proc~comm_get~2

Called by

proc~~allreduce_dp_array_to~2~~CalledByGraph proc~allreduce_dp_array_to~2 allreduce_dp_array_to interface~allreduce~2 allreduce interface~allreduce~2->proc~allreduce_dp_array_to~2

Variables

Type Visibility Attributes Name Initial
integer, private :: ierr
integer, private :: mpi_op
integer, private :: n

Source Code

   subroutine allreduce_dp_array_to(comm, sendbuf, recvbuf, count, op)
      type(comm_t), intent(in) :: comm
      real(dp), intent(in) :: sendbuf(:)
      real(dp), intent(out) :: recvbuf(:)
      integer, intent(in), optional :: count
      integer, intent(in), optional :: op
      integer :: mpi_op
      integer :: ierr, n

      if (present(count)) then
         n = count
      else
         n = size(sendbuf)
      end if

      if (present(op)) then
         mpi_op = op
      else
         mpi_op = MPI_SUM
      end if

      call MPI_Allreduce(sendbuf, recvbuf, n, MPI_DOUBLE_PRECISION, &
                         mpi_op, comm%get(), ierr)
   end subroutine allreduce_dp_array_to