allreduce_sp_array Subroutine

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

Arguments

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

Calls

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

Called by

proc~~allreduce_sp_array~~CalledByGraph proc~allreduce_sp_array allreduce_sp_array interface~allreduce allreduce interface~allreduce->proc~allreduce_sp_array proc~darray_gsumf darray_gsumf proc~darray_gsumf->interface~allreduce proc~darray_gsumi darray_gsumi proc~darray_gsumi->interface~allreduce

Variables

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

Source Code

   subroutine allreduce_sp_array(comm, buffer, count, op)
      type(comm_t), intent(in) :: comm
      real(sp), intent(inout) :: buffer(:)
      integer, intent(in), optional :: count
      type(MPI_Op), intent(in), optional :: op
      type(MPI_Op) :: mpi_op
      integer :: ierr, n

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

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

      call MPI_Allreduce(MPI_IN_PLACE, buffer, n, MPI_REAL, &
                         mpi_op, comm%get(), ierr)
   end subroutine allreduce_sp_array