54 type(wfs_elec_t),
allocatable :: psib(:, :)
56 integer :: block_start
58 integer,
allocatable :: iblock(:)
59 integer,
allocatable :: block_range(:, :)
60 integer,
allocatable :: block_size(:)
61 logical,
allocatable :: block_is_local(:, :)
62 integer,
allocatable :: block_node(:,:)
63 type(MPI_Win),
allocatable :: rma_win(:, :)
65 logical :: block_initialized = .false.
74 type(states_elec_group_t),
intent(inout) :: this
75 type(states_elec_dim_t),
intent(in) :: d
81 if (this%block_initialized)
then
82 do ib = 1, this%nblocks
83 do iq = d%kpt%start, d%kpt%end
84 if (this%block_is_local(ib, iq))
then
85 call this%psib(ib, iq)%end()
90 safe_deallocate_a(this%psib)
92 safe_deallocate_a(this%iblock)
93 safe_deallocate_a(this%block_range)
94 safe_deallocate_a(this%block_size)
95 safe_deallocate_a(this%block_is_local)
96 safe_deallocate_a(this%block_node)
97 safe_deallocate_a(this%rma_win)
98 this%block_initialized = .false.
108 type(states_elec_dim_t),
intent(in) :: d
109 type(states_elec_group_t),
intent(in) :: group_in
110 type(states_elec_group_t),
intent(inout) :: group_out
111 logical,
optional,
intent(in) :: copy_data
112 logical,
optional,
intent(in) :: special
113 type(type_t),
optional,
intent(in) :: dest_type
115 integer :: qn_start, qn_end, ib, iqn
121 group_out%nblocks = group_in%nblocks
122 group_out%block_start = group_in%block_start
123 group_out%block_end = group_in%block_end
124 group_out%block_initialized = group_in%block_initialized
126 if (group_out%block_initialized)
then
128 assert(
allocated(group_in%psib))
130 qn_start = d%kpt%start
133 safe_allocate(group_out%psib(1:group_out%nblocks, qn_start:qn_end))
135 do iqn = qn_start, qn_end
136 do ib = group_out%block_start, group_out%block_end
137 call group_in%psib(ib, iqn)%copy_to(group_out%psib(ib, iqn), &
142 safe_allocate_source_a(group_out%iblock, group_in%iblock)
143 safe_allocate_source_a(group_out%block_range, group_in%block_range)
144 safe_allocate_source_a(group_out%block_size, group_in%block_size)
145 safe_allocate_source_a(group_out%block_is_local, group_in%block_is_local)
146 safe_allocate_source_a(group_out%block_node, group_in%block_node)
148 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, dest_type)
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.