倍精度スカラの総和Allreduceをin-placeで実行する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mpi_context), | intent(in) | :: | ctx | |||
| real(kind=dp), | intent(inout) | :: | value |
subroutine mpi_allreduce_sum_real_dp_scalar(ctx, value) type(mpi_context), intent(in) :: ctx real(dp), intent(inout) :: value #ifdef USE_MPI include 'mpif.h' real(dp) :: recvval integer :: ierr if (.not. ctx%enabled) return call MPI_Allreduce(value, recvval, 1, MPI_DOUBLE_PRECISION, MPI_SUM, MPI_COMM_WORLD, ierr) value = recvval #endif end subroutine mpi_allreduce_sum_real_dp_scalar