53    type(wfs_elec_t), 
allocatable :: psib(:, :)
 
   55    integer                  :: block_start
 
   57    integer, 
allocatable     :: iblock(:)
 
   58    integer, 
allocatable     :: block_range(:, :)
 
   59    integer, 
allocatable     :: block_size(:)
 
   60    logical, 
allocatable     :: block_is_local(:, :)
 
   61    integer, 
allocatable     :: block_node(:)
 
   62    type(MPI_Win), 
allocatable :: rma_win(:, :)
 
   64    logical                  :: block_initialized = .false. 
 
   73    type(states_elec_group_t), 
intent(inout) :: this
 
   74    type(states_elec_dim_t),   
intent(in)    :: d
 
   80    if (this%block_initialized) 
then 
   81      do ib = 1, this%nblocks
 
   82        do iq = d%kpt%start, d%kpt%end
 
   83          if (this%block_is_local(ib, iq)) 
then 
   84            call this%psib(ib, iq)%end()
 
   89      safe_deallocate_a(this%psib)
 
   91      safe_deallocate_a(this%iblock)
 
   92      safe_deallocate_a(this%block_range)
 
   93      safe_deallocate_a(this%block_size)
 
   94      safe_deallocate_a(this%block_is_local)
 
   95      safe_deallocate_a(this%block_node)
 
   96      this%block_initialized = .false.
 
  106    type(states_elec_dim_t),   
intent(in)    :: d
 
  107    type(states_elec_group_t), 
intent(in)    :: group_in
 
  108    type(states_elec_group_t), 
intent(inout) :: group_out
 
  109    logical, 
optional,         
intent(in)    :: copy_data
 
  110    logical, 
optional,         
intent(in)    :: special
 
  112    integer :: qn_start, qn_end, ib, iqn
 
  118    group_out%nblocks           = group_in%nblocks
 
  119    group_out%block_start       = group_in%block_start
 
  120    group_out%block_end         = group_in%block_end
 
  121    group_out%block_initialized = group_in%block_initialized
 
  123    if (group_out%block_initialized) 
then 
  125      assert(
allocated(group_in%psib))
 
  127      qn_start = d%kpt%start
 
  130      safe_allocate(group_out%psib(1:group_out%nblocks, qn_start:qn_end))
 
  132      do iqn = qn_start, qn_end
 
  133        do ib = group_out%block_start, group_out%block_end
 
  134          call group_in%psib(ib, iqn)%copy_to(group_out%psib(ib, iqn), &
 
  139      safe_allocate_source_a(group_out%iblock, group_in%iblock)
 
  140      safe_allocate_source_a(group_out%block_range, group_in%block_range)
 
  141      safe_allocate_source_a(group_out%block_size, group_in%block_size)
 
  142      safe_allocate_source_a(group_out%block_is_local, group_in%block_is_local)
 
  143      safe_allocate_source_a(group_out%block_node, group_in%block_node)
 
  144      safe_allocate_source_a(group_out%rma_win, group_in%rma_win)
 
This module implements batches of mesh functions.
 
This module handles spin dimensions of the states and the k-point distribution.
 
This module handles groups of electronic batches and their parallel distribution.
 
subroutine, public states_elec_group_copy(d, group_in, group_out, copy_data, special)
make a copy of a group
 
subroutine, public states_elec_group_end(this, d)
finalize the local blocks of wave functions and release local arrays
 
Group of electronic states.