dbcsr_gatherv_any Subroutine

public subroutine dbcsr_gatherv_any(base, ub_base, msg, counts, displs, root, grp)

Gather function of encapsulated data.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_data_obj), intent(in) :: base
integer, intent(in) :: ub_base
type(dbcsr_data_obj), intent(inout) :: msg
integer, intent(in), DIMENSION(:), CONTIGUOUS :: counts
integer, intent(in), DIMENSION(:), CONTIGUOUS :: displs
integer, intent(in) :: root
type(mp_comm_type), intent(in) :: grp

Source Code

   SUBROUTINE dbcsr_gatherv_any(base, ub_base, msg, counts, displs, root, grp)
      !! Gather function of encapsulated data.
      TYPE(dbcsr_data_obj), INTENT(IN)                   :: base
      INTEGER, INTENT(IN)                                :: ub_base
      TYPE(dbcsr_data_obj), INTENT(INOUT)                :: msg
      INTEGER, DIMENSION(:), CONTIGUOUS, INTENT(IN)      :: counts, displs
      INTEGER, INTENT(IN)                                :: root
      TYPE(mp_comm_type), INTENT(IN)                     :: grp

      IF (dbcsr_data_get_type(base) .NE. dbcsr_data_get_type(msg)) &
         DBCSR_ABORT("Different data type for msgin and msgout")

      SELECT CASE (dbcsr_data_get_type(base))
      CASE (dbcsr_type_real_4)
         CALL mp_gatherv(base%d%r_sp(:ub_base), msg%d%r_sp, counts, displs, root, grp)
      CASE (dbcsr_type_real_8)
         CALL mp_gatherv(base%d%r_dp(:ub_base), msg%d%r_dp, counts, displs, root, grp)
      CASE (dbcsr_type_complex_4)
         CALL mp_gatherv(base%d%c_sp(:ub_base), msg%d%c_sp, counts, displs, root, grp)
      CASE (dbcsr_type_complex_8)
         CALL mp_gatherv(base%d%c_dp(:ub_base), msg%d%c_dp, counts, displs, root, grp)
      CASE default
         DBCSR_ABORT("Incorrect data type")
      END SELECT
   END SUBROUTINE dbcsr_gatherv_any