comms_no_sync_gatherv_real_1 Subroutine

private subroutine comms_no_sync_gatherv_real_1(array, localcount, rootglobalarray, counts, displs, error, comm)

Gather real data to root node (for arrays of rank 1)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: array(:)

local array for sending data

integer, intent(in) :: localcount

localcount elements will be sent to the root node

real(kind=dp), intent(inout) :: rootglobalarray(:)

array on the root node to which data will be sent

integer, intent(in) :: counts(0:)

how data should be partitioned, see MPI documentation or function comms_array_split

integer, intent(in) :: displs(0:)
type(w90_error_type), intent(out), allocatable :: error
type(w90_comm_type), intent(in) :: comm

Called by

proc~~comms_no_sync_gatherv_real_1~~CalledByGraph proc~comms_no_sync_gatherv_real_1 comms_no_sync_gatherv_real_1 interface~comms_no_sync_gatherv comms_no_sync_gatherv interface~comms_no_sync_gatherv->proc~comms_no_sync_gatherv_real_1 proc~comms_gatherv_real_1 comms_gatherv_real_1 proc~comms_gatherv_real_1->proc~comms_no_sync_gatherv_real_1 interface~comms_gatherv comms_gatherv interface~comms_gatherv->proc~comms_gatherv_real_1 proc~boltzwann_main boltzwann_main proc~boltzwann_main->interface~comms_gatherv proc~geninterp_main geninterp_main proc~geninterp_main->interface~comms_gatherv proc~k_path k_path proc~k_path->interface~comms_gatherv proc~k_slice k_slice proc~k_slice->interface~comms_gatherv program~postw90 postw90 program~postw90->proc~boltzwann_main program~postw90->proc~geninterp_main program~postw90->proc~k_path program~postw90->proc~k_slice

Source Code

  subroutine comms_no_sync_gatherv_real_1(array, localcount, rootglobalarray, counts, displs, error, comm)
    !! Gather real data to root node (for arrays of rank 1)
    implicit none

    real(kind=dp), intent(inout) :: array(:) !! local array for sending data
    integer, intent(in) :: localcount !! localcount elements will be sent to the root node
    real(kind=dp), intent(inout) :: rootglobalarray(:) !! array on the root node to which data will be sent
    integer, intent(in) :: counts(0:) !! how data should be partitioned, see MPI documentation or function comms_array_split
    integer, intent(in) :: displs(0:)
    type(w90_comm_type), intent(in) :: comm
    type(w90_error_type), allocatable, intent(out) :: error

#ifdef W90_MPI
    integer :: ierr

    call mpi_gatherv(array, localcount, MPI_DOUBLE_PRECISION, rootglobalarray, counts, &
                     displs, MPI_DOUBLE_PRECISION, root_id, comm%comm, ierr)

    if (ierr .ne. MPI_SUCCESS) then
      call set_base_error(error, 'Error in comms_gatherv_real_1', code_mpi)
      return
    end if
#else
    !call dcopy(localcount, array, 1, rootglobalarray, 1)
    rootglobalarray = array
#endif

  end subroutine comms_no_sync_gatherv_real_1