mpi_allreduce_sum_real_dp_array Subroutine

public subroutine mpi_allreduce_sum_real_dp_array(ctx, values)

倍精度配列の総和Allreduceをin-placeで実行する。

Arguments

Type IntentOptional Attributes Name
type(mpi_context), intent(in) :: ctx
real(kind=dp), intent(inout) :: values(:)

Called by

proc~~mpi_allreduce_sum_real_dp_array~~CalledByGraph proc~mpi_allreduce_sum_real_dp_array mpi_allreduce_sum_real_dp_array proc~perf_write_outputs perf_write_outputs proc~perf_write_outputs->proc~mpi_allreduce_sum_real_dp_array program~main main program~main->proc~perf_write_outputs

Source Code

  subroutine mpi_allreduce_sum_real_dp_array(ctx, values)
    type(mpi_context), intent(in) :: ctx
    real(dp), intent(inout) :: values(:)
#ifdef USE_MPI
    include 'mpif.h'
    real(dp), allocatable :: recvbuf(:)
    integer :: ierr

    if (.not. ctx%enabled) return
    allocate (recvbuf(size(values)))
    call MPI_Allreduce(values, recvbuf, size(values), MPI_DOUBLE_PRECISION, MPI_SUM, MPI_COMM_WORLD, ierr)
    values = recvbuf
#endif
  end subroutine mpi_allreduce_sum_real_dp_array