allreduce_dp_array Subroutine

private subroutine allreduce_dp_array(comm, buffer, count, op)

Arguments

Type IntentOptional Attributes Name
type(comm_t), intent(in) :: comm
real(kind=dp), intent(inout) :: buffer(:)
integer, intent(in), optional :: count
type(MPI_Op), intent(in), optional :: op

Calls

proc~~allreduce_dp_array~~CallsGraph proc~allreduce_dp_array allreduce_dp_array mpi_allreduce mpi_allreduce proc~allreduce_dp_array->mpi_allreduce proc~comm_get comm_t%comm_get proc~allreduce_dp_array->proc~comm_get

Called by

proc~~allreduce_dp_array~~CalledByGraph proc~allreduce_dp_array allreduce_dp_array interface~allreduce allreduce interface~allreduce->proc~allreduce_dp_array

Variables

Type Visibility Attributes Name Initial
integer, private :: ierr
integer, private :: n
type(MPI_Op), private :: op_used

Source Code

   subroutine allreduce_dp_array(comm, buffer, count, op)
      type(comm_t), intent(in) :: comm
      real(dp), intent(inout) :: buffer(:)
      integer, intent(in), optional :: count
      type(MPI_Op), intent(in), optional :: op
      type(MPI_Op) :: op_used
      integer :: ierr, n

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

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

      call MPI_Allreduce(MPI_IN_PLACE, buffer, n, MPI_DOUBLE_PRECISION, &
                         op_used, comm%get(), ierr)
   end subroutine allreduce_dp_array