dbcsr_get_global_vcol_map Subroutine

private subroutine dbcsr_get_global_vcol_map(imgdist, vcol_map)

Determines mapping from global to virtual local columns

Arguments

Type IntentOptional Attributes Name
type(dbcsr_imagedistribution_obj), intent(inout) :: imgdist

mapping for this image distribution

type(array_i1d_obj), intent(out) :: vcol_map

mapping to local columns


Source Code

   SUBROUTINE dbcsr_get_global_vcol_map(imgdist, vcol_map)
      !! Determines mapping from global to virtual local columns

      TYPE(dbcsr_imagedistribution_obj), INTENT(INOUT)   :: imgdist
         !! mapping for this image distribution
      TYPE(array_i1d_obj), INTENT(OUT)                   :: vcol_map
         !! mapping to local columns

      CHARACTER(len=*), PARAMETER :: routineN = 'dbcsr_get_global_vcol_map'

      INTEGER                                            :: error_handle, nvpcols
      INTEGER, DIMENSION(:), POINTER, CONTIGUOUS         :: rmap, vcol_dist

      IF (careful_mod) CALL timeset(routineN, error_handle)
      ! If the current local col mappings do not exist, create them.
      IF (.NOT. imgdist%i%has_global_vcol_map) THEN
         vcol_dist => array_data(imgdist%i%vcol_dist)
         ALLOCATE (rmap(SIZE(vcol_dist)))
         nvpcols = dbcsr_mp_npcols(dbcsr_distribution_mp(imgdist%i%main)) &
                   *imgdist%i%col_decimation
         CALL map_all_local_elements(rmap, vcol_dist, nvpcols)
         CALL array_new(imgdist%i%global_vcol_map, rmap, gift=.TRUE.)
         imgdist%i%has_global_vcol_map = .TRUE.
      ELSE
         IF (careful_mod .AND. .NOT. array_exists(imgdist%i%global_vcol_map)) &
            DBCSR_ABORT("Col map does not exist.")
      END IF
      vcol_map = imgdist%i%global_vcol_map
      IF (careful_mod) CALL timestop(error_handle)
   END SUBROUTINE dbcsr_get_global_vcol_map