block_buffer_create Subroutine

private subroutine block_buffer_create(buffer, nblock, ndata, data_type, ndim)

Create block buffer for MPI communication.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(out) :: buffer

block buffer

integer, intent(in) :: nblock

number of blocks total number of block entries number of dimensions

integer, intent(in) :: ndata

number of blocks total number of block entries number of dimensions

integer, intent(in) :: data_type

number of blocks total number of block entries number of dimensions

integer, intent(in) :: ndim

number of blocks total number of block entries number of dimensions


Contents

Source Code


Source Code

   SUBROUTINE block_buffer_create(buffer, nblock, ndata, data_type, ndim)
      !! Create block buffer for MPI communication.

      TYPE(block_buffer_type), INTENT(OUT) :: buffer
         !! block buffer
      INTEGER, INTENT(IN)                  :: nblock, ndata, data_type, ndim
         !! number of blocks
         !! total number of block entries
         !! number of dimensions

      buffer%nblock = nblock
      buffer%data_type = data_type
      buffer%endpos = 0
      buffer%ndim = ndim
      SELECT CASE (data_type)
# 199 "/__w/dbcsr/dbcsr/src/tensors/dbcsr_tensor_reshape.F"
            CASE (dbcsr_type_real_8)
            ALLOCATE (buffer%msg_r_dp (ndata))
# 199 "/__w/dbcsr/dbcsr/src/tensors/dbcsr_tensor_reshape.F"
            CASE (dbcsr_type_real_4)
            ALLOCATE (buffer%msg_r_sp (ndata))
# 199 "/__w/dbcsr/dbcsr/src/tensors/dbcsr_tensor_reshape.F"
            CASE (dbcsr_type_complex_8)
            ALLOCATE (buffer%msg_c_dp (ndata))
# 199 "/__w/dbcsr/dbcsr/src/tensors/dbcsr_tensor_reshape.F"
            CASE (dbcsr_type_complex_4)
            ALLOCATE (buffer%msg_c_sp (ndata))
# 202 "/__w/dbcsr/dbcsr/src/tensors/dbcsr_tensor_reshape.F"
      END SELECT
      ALLOCATE (buffer%indx(nblock, ndim + 1))
   END SUBROUTINE block_buffer_create