comms_gatherv_logical Subroutine

private subroutine comms_gatherv_logical(array, localcount, rootglobalarray, counts, displs)

Gather real data to root node

Arguments

Type IntentOptional AttributesName
logical, intent(inout) :: array

local array for sending data

integer, intent(in) :: localcount

localcount elements will be sent to the root node

logical, intent(inout) :: rootglobalarray

array on the root node to which data will be sent

integer, intent(in), dimension(num_nodes):: counts

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

integer, intent(in), dimension(num_nodes):: displs

Called by

proc~~comms_gatherv_logical~~CalledByGraph proc~comms_gatherv_logical comms_gatherv_logical interface~comms_gatherv comms_gatherv interface~comms_gatherv->proc~comms_gatherv_logical proc~k_path k_path proc~k_path->interface~comms_gatherv proc~k_slice k_slice proc~k_slice->interface~comms_gatherv

Contents

Source Code


Source Code

  subroutine comms_gatherv_logical(array, localcount, rootglobalarray, counts, displs)
    !! Gather real data to root node
    implicit none

    logical, intent(inout)           :: array
    !! local array for sending data
    integer, intent(in)                       :: localcount
    !! localcount elements will be sent to the root node
    logical, intent(inout)           :: rootglobalarray
    !! array on the root node to which data will be sent
    integer, dimension(num_nodes), intent(in) :: counts
    !! how data should be partitioned, see MPI documentation or
    !! function comms_array_split
    integer, dimension(num_nodes), intent(in) :: displs

#ifdef MPI
    integer :: error

    call MPI_gatherv(array, localcount, MPI_logical, rootglobalarray, counts, &
                     displs, MPI_logical, root_id, mpi_comm_world, error)

    if (error .ne. MPI_success) then
      call io_error('Error in comms_gatherv_logical')
    end if
#else
!    rootglobalarray(1:localcount)=array(1:localcount)
#endif

  end subroutine comms_gatherv_logical