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 safe_deallocate_a(this%rma_win)
97 this%block_initialized = .false.
107 type(states_elec_dim_t),
intent(in) :: d
108 type(states_elec_group_t),
intent(in) :: group_in
109 type(states_elec_group_t),
intent(inout) :: group_out
110 logical,
optional,
intent(in) :: copy_data
111 logical,
optional,
intent(in) :: special
113 integer :: qn_start, qn_end, ib, iqn
119 group_out%nblocks = group_in%nblocks
120 group_out%block_start = group_in%block_start
121 group_out%block_end = group_in%block_end
122 group_out%block_initialized = group_in%block_initialized
124 if (group_out%block_initialized)
then
126 assert(
allocated(group_in%psib))
128 qn_start = d%kpt%start
131 safe_allocate(group_out%psib(1:group_out%nblocks, qn_start:qn_end))
133 do iqn = qn_start, qn_end
134 do ib = group_out%block_start, group_out%block_end
135 call group_in%psib(ib, iqn)%copy_to(group_out%psib(ib, iqn), &
140 safe_allocate_source_a(group_out%iblock, group_in%iblock)
141 safe_allocate_source_a(group_out%block_range, group_in%block_range)
142 safe_allocate_source_a(group_out%block_size, group_in%block_size)
143 safe_allocate_source_a(group_out%block_is_local, group_in%block_is_local)
144 safe_allocate_source_a(group_out%block_node, group_in%block_node)
146 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.