倍精度配列の最小値Allreduceをin-placeで実行する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mpi_context), | intent(in) | :: | ctx | |||
| real(kind=dp), | intent(inout) | :: | values(:) |
subroutine mpi_allreduce_min_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_MIN, MPI_COMM_WORLD, ierr) values = recvbuf #endif end subroutine mpi_allreduce_min_real_dp_array