Reduce complex data to all nodes
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| complex(kind=dp), | intent(inout) | :: | array | |||
| integer, | intent(in) | :: | size | |||
| character(len=*), | intent(in) | :: | op | |||
| type(w90_error_type), | intent(out), | allocatable | :: | error | ||
| type(w90_comm_type), | intent(in) | :: | comm |
subroutine comms_no_sync_allreduce_cmplx(array, size, op, error, comm) !! Reduce complex data to all nodes implicit none complex(kind=dp), intent(inout) :: array integer, intent(in) :: size character(len=*), intent(in) :: op type(w90_comm_type), intent(in) :: comm type(w90_error_type), allocatable, intent(out) :: error #ifdef W90_MPI integer :: ierr select case (op) case ('SUM') call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_COMPLEX, MPI_SUM, comm%comm, & ierr) case ('PRD') call mpi_allreduce(MPI_IN_PLACE, array, size, MPI_DOUBLE_COMPLEX, MPI_PROD, comm%comm, & ierr) case default call set_base_error(error, 'Unknown operation in comms_allreduce_cmplx', code_mpi) return end select if (ierr .ne. MPI_SUCCESS) then call set_base_error(error, 'Error in comms_allreduce_cmplx', code_mpi) return end if #endif end subroutine comms_no_sync_allreduce_cmplx