83#include "./base/base_uses.f90"
89 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'bse_util'
110 SUBROUTINE mult_b_with_w(fm_mat_S_ij_bse, fm_mat_S_ia_bse, fm_mat_S_bar_ia_bse, &
111 fm_mat_S_bar_ij_bse, fm_mat_Q_static_bse_gemm, &
112 dimen_RI, homo, virtual)
114 TYPE(
cp_fm_type),
INTENT(IN) :: fm_mat_s_ij_bse, fm_mat_s_ia_bse
115 TYPE(
cp_fm_type),
INTENT(OUT) :: fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse
116 TYPE(
cp_fm_type),
INTENT(IN) :: fm_mat_q_static_bse_gemm
117 INTEGER,
INTENT(IN) :: dimen_ri, homo, virtual
119 CHARACTER(LEN=*),
PARAMETER :: routinen =
'mult_B_with_W'
121 INTEGER :: handle, i_global, iib, info_chol, &
122 j_global, jjb, ncol_local, nrow_local
123 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
126 CALL timeset(routinen, handle)
128 CALL cp_fm_create(fm_mat_s_bar_ia_bse, fm_mat_s_ia_bse%matrix_struct)
131 CALL cp_fm_create(fm_mat_s_bar_ij_bse, fm_mat_s_ij_bse%matrix_struct)
134 CALL cp_fm_create(fm_work, fm_mat_q_static_bse_gemm%matrix_struct)
139 nrow_local=nrow_local, &
140 ncol_local=ncol_local, &
141 row_indices=row_indices, &
142 col_indices=col_indices)
144 DO jjb = 1, ncol_local
145 j_global = col_indices(jjb)
146 DO iib = 1, nrow_local
147 i_global = row_indices(iib)
148 IF (j_global == i_global .AND. i_global <= dimen_ri)
THEN
149 fm_mat_q_static_bse_gemm%local_data(iib, jjb) = fm_mat_q_static_bse_gemm%local_data(iib, jjb) + 1.0_dp
157 IF (info_chol /= 0)
THEN
158 CALL cp_abort(__location__,
'Cholesky decomposition failed for static polarization in BSE')
167 CALL parallel_gemm(transa=
"N", transb=
"N", m=dimen_ri, n=homo**2, k=dimen_ri, alpha=1.0_dp, &
168 matrix_a=fm_mat_q_static_bse_gemm, matrix_b=fm_mat_s_ij_bse, beta=0.0_dp, &
169 matrix_c=fm_mat_s_bar_ij_bse)
173 CALL parallel_gemm(transa=
"N", transb=
"N", m=dimen_ri, n=homo*virtual, k=dimen_ri, alpha=1.0_dp, &
174 matrix_a=fm_mat_q_static_bse_gemm, matrix_b=fm_mat_s_ia_bse, beta=0.0_dp, &
175 matrix_c=fm_mat_s_bar_ia_bse)
179 CALL timestop(handle)
198 nrow_secidx_out, ncol_secidx_out, unit_nr, reordering, mp2_env)
202 REAL(kind=
dp) :: beta
203 INTEGER,
INTENT(IN) :: nrow_secidx_in, ncol_secidx_in, &
204 nrow_secidx_out, ncol_secidx_out
206 INTEGER,
DIMENSION(4) :: reordering
207 TYPE(
mp2_type),
INTENT(IN) :: mp2_env
209 CHARACTER(LEN=*),
PARAMETER :: routinen =
'fm_general_add_bse'
211 INTEGER :: col_idx_loc, dummy, handle, handle2, i_entry_rec, idx_col_out, idx_row_out, ii, &
212 iproc, jj, ncol_block_in, ncol_block_out, ncol_local_in, ncol_local_out, nprocs, &
213 nrow_block_in, nrow_block_out, nrow_local_in, nrow_local_out, proc_send, row_idx_loc, &
215 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: entry_counter, num_entries_rec, &
217 INTEGER,
DIMENSION(4) :: indices_in
218 INTEGER,
DIMENSION(:),
POINTER :: col_indices_in, col_indices_out, &
219 row_indices_in, row_indices_out
221 DIMENSION(:) :: buffer_rec, buffer_send
225 CALL timeset(routinen, handle)
226 CALL timeset(routinen//
"_1_setup", handle2)
228 para_env_out => fm_out%matrix_struct%para_env
232 nrow_local=nrow_local_out, &
233 ncol_local=ncol_local_out, &
234 row_indices=row_indices_out, &
235 col_indices=col_indices_out, &
236 nrow_block=nrow_block_out, &
237 ncol_block=ncol_block_out)
239 ALLOCATE (num_entries_rec(0:para_env_out%num_pe - 1))
240 ALLOCATE (num_entries_send(0:para_env_out%num_pe - 1))
242 num_entries_rec(:) = 0
243 num_entries_send(:) = 0
248 nrow_local=nrow_local_in, &
249 ncol_local=ncol_local_in, &
250 row_indices=row_indices_in, &
251 col_indices=col_indices_in, &
252 nrow_block=nrow_block_in, &
253 ncol_block=ncol_block_in)
255 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
256 WRITE (unit_nr,
'(T2,A10,T13,A14,A10,T71,I10)')
'BSE|DEBUG|',
'Row number of ', fm_out%name, &
257 fm_out%matrix_struct%nrow_global
258 WRITE (unit_nr,
'(T2,A10,T13,A17,A10,T71,I10)')
'BSE|DEBUG|',
'Column number of ', fm_out%name, &
259 fm_out%matrix_struct%ncol_global
261 WRITE (unit_nr,
'(T2,A10,T13,A18,A10,T71,I10)')
'BSE|DEBUG|',
'Row block size of ', fm_out%name, nrow_block_out
262 WRITE (unit_nr,
'(T2,A10,T13,A21,A10,T71,I10)')
'BSE|DEBUG|',
'Column block size of ', fm_out%name, ncol_block_out
264 WRITE (unit_nr,
'(T2,A10,T13,A14,A10,T71,I10)')
'BSE|DEBUG|',
'Row number of ', fm_in%name, &
265 fm_in%matrix_struct%nrow_global
266 WRITE (unit_nr,
'(T2,A10,T13,A17,A10,T71,I10)')
'BSE|DEBUG|',
'Column number of ', fm_in%name, &
267 fm_in%matrix_struct%ncol_global
269 WRITE (unit_nr,
'(T2,A10,T13,A18,A10,T71,I10)')
'BSE|DEBUG|',
'Row block size of ', fm_in%name, nrow_block_in
270 WRITE (unit_nr,
'(T2,A10,T13,A21,A10,T71,I10)')
'BSE|DEBUG|',
'Column block size of ', fm_in%name, ncol_block_in
276 DO row_idx_loc = 1, nrow_local_in
277 indices_in(1) = (row_indices_in(row_idx_loc) - 1)/nrow_secidx_in + 1
278 indices_in(2) = mod(row_indices_in(row_idx_loc) - 1, nrow_secidx_in) + 1
279 DO col_idx_loc = 1, ncol_local_in
280 indices_in(3) = (col_indices_in(col_idx_loc) - 1)/ncol_secidx_in + 1
281 indices_in(4) = mod(col_indices_in(col_idx_loc) - 1, ncol_secidx_in) + 1
283 idx_row_out = indices_in(reordering(2)) + (indices_in(reordering(1)) - 1)*nrow_secidx_out
284 idx_col_out = indices_in(reordering(4)) + (indices_in(reordering(3)) - 1)*ncol_secidx_out
286 send_prow = fm_out%matrix_struct%g2p_row(idx_row_out)
287 send_pcol = fm_out%matrix_struct%g2p_col(idx_col_out)
289 proc_send = fm_out%matrix_struct%context%blacs2mpi(send_prow, send_pcol)
291 num_entries_send(proc_send) = num_entries_send(proc_send) + 1
296 CALL timestop(handle2)
298 CALL timeset(routinen//
"_2_comm_entry_nums", handle2)
299 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
300 WRITE (unit_nr,
'(T2,A10,T13,A27)')
'BSE|DEBUG|',
'Communicating entry numbers'
303 CALL para_env_out%alltoall(num_entries_send, num_entries_rec, 1)
305 CALL timestop(handle2)
307 CALL timeset(routinen//
"_3_alloc_buffer", handle2)
308 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
309 WRITE (unit_nr,
'(T2,A10,T13,A18)')
'BSE|DEBUG|',
'Allocating buffers'
313 ALLOCATE (buffer_rec(0:para_env_out%num_pe - 1))
314 ALLOCATE (buffer_send(0:para_env_out%num_pe - 1))
317 DO iproc = 0, para_env_out%num_pe - 1
319 ALLOCATE (buffer_rec(iproc)%msg(num_entries_rec(iproc)))
320 buffer_rec(iproc)%msg = 0.0_dp
324 DO iproc = 0, para_env_out%num_pe - 1
326 ALLOCATE (buffer_send(iproc)%msg(num_entries_send(iproc)))
327 buffer_send(iproc)%msg = 0.0_dp
331 DO iproc = 0, para_env_out%num_pe - 1
333 ALLOCATE (buffer_rec(iproc)%indx(num_entries_rec(iproc), 2))
334 buffer_rec(iproc)%indx = 0
338 DO iproc = 0, para_env_out%num_pe - 1
340 ALLOCATE (buffer_send(iproc)%indx(num_entries_send(iproc), 2))
341 buffer_send(iproc)%indx = 0
345 CALL timestop(handle2)
347 CALL timeset(routinen//
"_4_buf_from_fmin_"//fm_out%name, handle2)
348 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
349 WRITE (unit_nr,
'(T2,A10,T13,A18,A10,A13)')
'BSE|DEBUG|',
'Writing data from ', fm_in%name,
' into buffers'
352 ALLOCATE (entry_counter(0:para_env_out%num_pe - 1))
356 DO row_idx_loc = 1, nrow_local_in
357 indices_in(1) = (row_indices_in(row_idx_loc) - 1)/nrow_secidx_in + 1
358 indices_in(2) = mod(row_indices_in(row_idx_loc) - 1, nrow_secidx_in) + 1
359 DO col_idx_loc = 1, ncol_local_in
360 indices_in(3) = (col_indices_in(col_idx_loc) - 1)/ncol_secidx_in + 1
361 indices_in(4) = mod(col_indices_in(col_idx_loc) - 1, ncol_secidx_in) + 1
363 idx_row_out = indices_in(reordering(2)) + (indices_in(reordering(1)) - 1)*nrow_secidx_out
364 idx_col_out = indices_in(reordering(4)) + (indices_in(reordering(3)) - 1)*ncol_secidx_out
366 send_prow = fm_out%matrix_struct%g2p_row(idx_row_out)
367 send_pcol = fm_out%matrix_struct%g2p_col(idx_col_out)
369 proc_send = fm_out%matrix_struct%context%blacs2mpi(send_prow, send_pcol)
370 entry_counter(proc_send) = entry_counter(proc_send) + 1
372 buffer_send(proc_send)%msg(entry_counter(proc_send)) = &
373 fm_in%local_data(row_idx_loc, col_idx_loc)
375 buffer_send(proc_send)%indx(entry_counter(proc_send), 1) = idx_row_out
376 buffer_send(proc_send)%indx(entry_counter(proc_send), 2) = idx_col_out
381 ALLOCATE (req_array(1:para_env_out%num_pe, 4))
383 CALL timestop(handle2)
385 CALL timeset(routinen//
"_5_comm_buffer", handle2)
386 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
387 WRITE (unit_nr,
'(T2,A10,T13,A21)')
'BSE|DEBUG|',
'Communicating buffers'
391 CALL communicate_buffer(para_env_out, num_entries_rec, num_entries_send, buffer_rec, &
392 buffer_send, req_array)
394 CALL timestop(handle2)
396 CALL timeset(routinen//
"_6_buffer_to_fmout"//fm_out%name, handle2)
397 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
398 WRITE (unit_nr,
'(T2,A10,T13,A24,A10)')
'BSE|DEBUG|',
'Writing from buffers to ', fm_out%name
402 nprocs = para_env_out%num_pe
407 DO iproc = 0, nprocs - 1
408 DO i_entry_rec = 1, num_entries_rec(iproc)
409 ii = fm_out%matrix_struct%g2l_row(buffer_rec(iproc)%indx(i_entry_rec, 1))
410 jj = fm_out%matrix_struct%g2l_col(buffer_rec(iproc)%indx(i_entry_rec, 2))
412 fm_out%local_data(ii, jj) = fm_out%local_data(ii, jj) + beta*buffer_rec(iproc)%msg(i_entry_rec)
417 CALL timestop(handle2)
419 CALL timeset(routinen//
"_7_cleanup", handle2)
420 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
421 WRITE (unit_nr,
'(T2,A10,T13,A41)')
'BSE|DEBUG|',
'Starting cleanup of communication buffers'
425 DO iproc = 0, para_env_out%num_pe - 1
426 DEALLOCATE (buffer_rec(iproc)%msg)
427 DEALLOCATE (buffer_rec(iproc)%indx)
428 DEALLOCATE (buffer_send(iproc)%msg)
429 DEALLOCATE (buffer_send(iproc)%indx)
431 DEALLOCATE (buffer_rec, buffer_send)
432 DEALLOCATE (req_array)
433 DEALLOCATE (entry_counter)
434 DEALLOCATE (num_entries_rec, num_entries_send)
436 CALL timestop(handle2)
437 CALL timestop(handle)
457 nrow_out, ncol_out, unit_nr, mp2_env, &
458 nrow_offset, ncol_offset)
462 INTEGER :: ncol_in, nrow_out, ncol_out, unit_nr
463 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
464 INTEGER,
INTENT(IN),
OPTIONAL :: nrow_offset, ncol_offset
466 CHARACTER(LEN=*),
PARAMETER :: routinen =
'truncate_fm'
468 INTEGER :: col_idx_loc, dummy, handle, handle2, i_entry_rec, idx_col_first, idx_col_in, &
469 idx_col_out, idx_col_sec, idx_row_in, ii, iproc, jj, ncol_block_in, ncol_block_out, &
470 ncol_local_in, ncol_local_out, nprocs, nrow_block_in, nrow_block_out, nrow_local_in, &
471 nrow_local_out, proc_send, row_idx_loc, send_pcol, send_prow
472 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: entry_counter, num_entries_rec, &
474 INTEGER,
DIMENSION(:),
POINTER :: col_indices_in, col_indices_out, &
475 row_indices_in, row_indices_out
476 LOGICAL :: correct_ncol, correct_nrow
478 DIMENSION(:) :: buffer_rec, buffer_send
482 CALL timeset(routinen, handle)
483 CALL timeset(routinen//
"_1_setup", handle2)
485 correct_nrow = .false.
486 correct_ncol = .false.
488 IF (
PRESENT(nrow_offset))
THEN
489 correct_nrow = .true.
491 IF (
PRESENT(ncol_offset))
THEN
492 correct_ncol = .true.
495 para_env_out => fm_out%matrix_struct%para_env
498 nrow_local=nrow_local_out, &
499 ncol_local=ncol_local_out, &
500 row_indices=row_indices_out, &
501 col_indices=col_indices_out, &
502 nrow_block=nrow_block_out, &
503 ncol_block=ncol_block_out)
505 ALLOCATE (num_entries_rec(0:para_env_out%num_pe - 1))
506 ALLOCATE (num_entries_send(0:para_env_out%num_pe - 1))
508 num_entries_rec(:) = 0
509 num_entries_send(:) = 0
514 nrow_local=nrow_local_in, &
515 ncol_local=ncol_local_in, &
516 row_indices=row_indices_in, &
517 col_indices=col_indices_in, &
518 nrow_block=nrow_block_in, &
519 ncol_block=ncol_block_in)
521 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
522 WRITE (unit_nr,
'(T2,A10,T13,A14,A10,T71,I10)')
'BSE|DEBUG|',
'Row number of ', fm_out%name, &
523 fm_out%matrix_struct%nrow_global
524 WRITE (unit_nr,
'(T2,A10,T13,A17,A10,T71,I10)')
'BSE|DEBUG|',
'Column number of ', fm_out%name, &
525 fm_out%matrix_struct%ncol_global
527 WRITE (unit_nr,
'(T2,A10,T13,A18,A10,T71,I10)')
'BSE|DEBUG|',
'Row block size of ', fm_out%name, nrow_block_out
528 WRITE (unit_nr,
'(T2,A10,T13,A21,A10,T71,I10)')
'BSE|DEBUG|',
'Column block size of ', fm_out%name, ncol_block_out
530 WRITE (unit_nr,
'(T2,A10,T13,A14,A10,T71,I10)')
'BSE|DEBUG|',
'Row number of ', fm_in%name, &
531 fm_in%matrix_struct%nrow_global
532 WRITE (unit_nr,
'(T2,A10,T13,A17,A10,T71,I10)')
'BSE|DEBUG|',
'Column number of ', fm_in%name, &
533 fm_in%matrix_struct%ncol_global
535 WRITE (unit_nr,
'(T2,A10,T13,A18,A10,T71,I10)')
'BSE|DEBUG|',
'Row block size of ', fm_in%name, nrow_block_in
536 WRITE (unit_nr,
'(T2,A10,T13,A21,A10,T71,I10)')
'BSE|DEBUG|',
'Column block size of ', fm_in%name, ncol_block_in
540 DO col_idx_loc = 1, ncol_local_in
541 idx_col_in = col_indices_in(col_idx_loc)
543 idx_col_first = (idx_col_in - 1)/ncol_in + 1
544 idx_col_sec = mod(idx_col_in - 1, ncol_in) + 1
548 IF (correct_nrow)
THEN
549 idx_col_first = idx_col_first - nrow_offset + 1
550 IF (idx_col_first .LE. 0) cycle
552 IF (idx_col_first > nrow_out)
EXIT
554 IF (correct_ncol)
THEN
555 idx_col_sec = idx_col_sec - ncol_offset + 1
556 IF (idx_col_sec .LE. 0) cycle
558 IF (idx_col_sec > ncol_out) cycle
561 idx_col_out = idx_col_sec + (idx_col_first - 1)*ncol_out
563 DO row_idx_loc = 1, nrow_local_in
564 idx_row_in = row_indices_in(row_idx_loc)
566 send_prow = fm_out%matrix_struct%g2p_row(idx_row_in)
567 send_pcol = fm_out%matrix_struct%g2p_col(idx_col_out)
569 proc_send = fm_out%matrix_struct%context%blacs2mpi(send_prow, send_pcol)
571 num_entries_send(proc_send) = num_entries_send(proc_send) + 1
576 CALL timestop(handle2)
578 CALL timeset(routinen//
"_2_comm_entry_nums", handle2)
579 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
580 WRITE (unit_nr,
'(T2,A10,T13,A27)')
'BSE|DEBUG|',
'Communicating entry numbers'
583 CALL para_env_out%alltoall(num_entries_send, num_entries_rec, 1)
585 CALL timestop(handle2)
587 CALL timeset(routinen//
"_3_alloc_buffer", handle2)
588 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
589 WRITE (unit_nr,
'(T2,A10,T13,A18)')
'BSE|DEBUG|',
'Allocating buffers'
593 ALLOCATE (buffer_rec(0:para_env_out%num_pe - 1))
594 ALLOCATE (buffer_send(0:para_env_out%num_pe - 1))
597 DO iproc = 0, para_env_out%num_pe - 1
599 ALLOCATE (buffer_rec(iproc)%msg(num_entries_rec(iproc)))
600 buffer_rec(iproc)%msg = 0.0_dp
604 DO iproc = 0, para_env_out%num_pe - 1
606 ALLOCATE (buffer_send(iproc)%msg(num_entries_send(iproc)))
607 buffer_send(iproc)%msg = 0.0_dp
611 DO iproc = 0, para_env_out%num_pe - 1
613 ALLOCATE (buffer_rec(iproc)%indx(num_entries_rec(iproc), 2))
614 buffer_rec(iproc)%indx = 0
618 DO iproc = 0, para_env_out%num_pe - 1
620 ALLOCATE (buffer_send(iproc)%indx(num_entries_send(iproc), 2))
621 buffer_send(iproc)%indx = 0
625 CALL timestop(handle2)
627 CALL timeset(routinen//
"_4_buf_from_fmin_"//fm_out%name, handle2)
628 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
629 WRITE (unit_nr,
'(T2,A10,T13,A18,A10,A13)')
'BSE|DEBUG|',
'Writing data from ', fm_in%name,
' into buffers'
632 ALLOCATE (entry_counter(0:para_env_out%num_pe - 1))
636 DO col_idx_loc = 1, ncol_local_in
637 idx_col_in = col_indices_in(col_idx_loc)
639 idx_col_first = (idx_col_in - 1)/ncol_in + 1
640 idx_col_sec = mod(idx_col_in - 1, ncol_in) + 1
644 IF (correct_nrow)
THEN
645 idx_col_first = idx_col_first - nrow_offset + 1
646 IF (idx_col_first .LE. 0) cycle
648 IF (idx_col_first > nrow_out)
EXIT
650 IF (correct_ncol)
THEN
651 idx_col_sec = idx_col_sec - ncol_offset + 1
652 IF (idx_col_sec .LE. 0) cycle
654 IF (idx_col_sec > ncol_out) cycle
657 idx_col_out = idx_col_sec + (idx_col_first - 1)*ncol_out
659 DO row_idx_loc = 1, nrow_local_in
660 idx_row_in = row_indices_in(row_idx_loc)
662 send_prow = fm_out%matrix_struct%g2p_row(idx_row_in)
664 send_pcol = fm_out%matrix_struct%g2p_col(idx_col_out)
666 proc_send = fm_out%matrix_struct%context%blacs2mpi(send_prow, send_pcol)
667 entry_counter(proc_send) = entry_counter(proc_send) + 1
669 buffer_send(proc_send)%msg(entry_counter(proc_send)) = &
670 fm_in%local_data(row_idx_loc, col_idx_loc)
673 buffer_send(proc_send)%indx(entry_counter(proc_send), 1) = idx_row_in
674 buffer_send(proc_send)%indx(entry_counter(proc_send), 2) = idx_col_out
679 ALLOCATE (req_array(1:para_env_out%num_pe, 4))
681 CALL timestop(handle2)
683 CALL timeset(routinen//
"_5_comm_buffer", handle2)
684 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
685 WRITE (unit_nr,
'(T2,A10,T13,A21)')
'BSE|DEBUG|',
'Communicating buffers'
689 CALL communicate_buffer(para_env_out, num_entries_rec, num_entries_send, buffer_rec, &
690 buffer_send, req_array)
692 CALL timestop(handle2)
694 CALL timeset(routinen//
"_6_buffer_to_fmout"//fm_out%name, handle2)
695 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
696 WRITE (unit_nr,
'(T2,A10,T13,A24,A10)')
'BSE|DEBUG|',
'Writing from buffers to ', fm_out%name
700 nprocs = para_env_out%num_pe
705 DO iproc = 0, nprocs - 1
706 DO i_entry_rec = 1, num_entries_rec(iproc)
707 ii = fm_out%matrix_struct%g2l_row(buffer_rec(iproc)%indx(i_entry_rec, 1))
708 jj = fm_out%matrix_struct%g2l_col(buffer_rec(iproc)%indx(i_entry_rec, 2))
710 fm_out%local_data(ii, jj) = fm_out%local_data(ii, jj) + buffer_rec(iproc)%msg(i_entry_rec)
715 CALL timestop(handle2)
717 CALL timeset(routinen//
"_7_cleanup", handle2)
718 IF (unit_nr > 0 .AND. mp2_env%bse%bse_debug_print)
THEN
719 WRITE (unit_nr,
'(T2,A10,T13,A41)')
'BSE|DEBUG|',
'Starting cleanup of communication buffers'
723 DO iproc = 0, para_env_out%num_pe - 1
724 DEALLOCATE (buffer_rec(iproc)%msg)
725 DEALLOCATE (buffer_rec(iproc)%indx)
726 DEALLOCATE (buffer_send(iproc)%msg)
727 DEALLOCATE (buffer_send(iproc)%indx)
729 DEALLOCATE (buffer_rec, buffer_send)
730 DEALLOCATE (req_array)
731 DEALLOCATE (entry_counter)
732 DEALLOCATE (num_entries_rec, num_entries_send)
734 CALL timestop(handle2)
735 CALL timestop(handle)
750 fm_mat_S_trunc, fm_mat_S_ij_trunc, fm_mat_S_ab_trunc, &
751 fm_mat_Q_static_bse_gemm, mp2_env)
753 TYPE(
cp_fm_type),
INTENT(INOUT) :: fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse, fm_mat_s_trunc, &
754 fm_mat_s_ij_trunc, fm_mat_s_ab_trunc, fm_mat_q_static_bse_gemm
757 CHARACTER(LEN=*),
PARAMETER :: routinen =
'deallocate_matrices_bse'
761 CALL timeset(routinen, handle)
769 IF (mp2_env%bse%do_nto_analysis)
THEN
770 DEALLOCATE (mp2_env%bse%bse_nto_state_list_final)
773 CALL timestop(handle)
789 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:), &
790 INTENT(IN) :: eig_vals
791 REAL(kind=
dp),
INTENT(IN) :: beta
792 REAL(kind=
dp),
INTENT(IN),
OPTIONAL ::
gamma
793 LOGICAL,
INTENT(IN),
OPTIONAL :: do_transpose
795 CHARACTER(LEN=*),
PARAMETER :: routinen =
'comp_eigvec_coeff_BSE'
797 INTEGER :: handle, i_row_global, ii, j_col_global, &
798 jj, ncol_local, nrow_local
799 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
800 LOGICAL :: my_do_transpose
801 REAL(kind=
dp) :: coeff, my_gamma
803 CALL timeset(routinen, handle)
805 IF (
PRESENT(
gamma))
THEN
811 IF (
PRESENT(do_transpose))
THEN
812 my_do_transpose = do_transpose
814 my_do_transpose = .false.
818 nrow_local=nrow_local, &
819 ncol_local=ncol_local, &
820 row_indices=row_indices, &
821 col_indices=col_indices)
823 IF (my_do_transpose)
THEN
824 DO jj = 1, ncol_local
825 j_col_global = col_indices(jj)
826 DO ii = 1, nrow_local
827 coeff = (eig_vals(j_col_global)**beta)/my_gamma
828 fm_work%local_data(ii, jj) = fm_work%local_data(ii, jj)*coeff
832 DO jj = 1, ncol_local
833 DO ii = 1, nrow_local
834 i_row_global = row_indices(ii)
835 coeff = (eig_vals(i_row_global)**beta)/my_gamma
836 fm_work%local_data(ii, jj) = fm_work%local_data(ii, jj)*coeff
841 CALL timestop(handle)
853 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: idx_prim, idx_sec
854 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigvec_entries
856 CHARACTER(LEN=*),
PARAMETER :: routinen =
'sort_excitations'
858 INTEGER :: handle, ii, kk, num_entries, num_mults
859 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: idx_prim_work, idx_sec_work, tmp_index
860 LOGICAL :: unique_entries
861 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigvec_entries_work
863 CALL timeset(routinen, handle)
865 num_entries =
SIZE(idx_prim)
867 ALLOCATE (tmp_index(num_entries))
869 CALL sort(idx_prim, num_entries, tmp_index)
871 ALLOCATE (idx_sec_work(num_entries))
872 ALLOCATE (eigvec_entries_work(num_entries))
874 DO ii = 1, num_entries
875 idx_sec_work(ii) = idx_sec(tmp_index(ii))
876 eigvec_entries_work(ii) = eigvec_entries(tmp_index(ii))
879 DEALLOCATE (tmp_index)
881 DEALLOCATE (eigvec_entries)
883 CALL move_alloc(idx_sec_work, idx_sec)
884 CALL move_alloc(eigvec_entries_work, eigvec_entries)
888 IF (.NOT. unique_entries)
THEN
889 ALLOCATE (idx_prim_work(num_entries))
890 idx_prim_work(:) = idx_prim(:)
892 DO ii = 1, num_entries
893 IF (idx_prim_work(ii) == 0) cycle
894 num_mults = count(idx_prim_work == idx_prim_work(ii))
895 IF (num_mults > 1)
THEN
897 idx_prim_work(ii:ii + num_mults - 1) = 0
899 ALLOCATE (idx_sec_work(num_mults))
900 ALLOCATE (eigvec_entries_work(num_mults))
901 idx_sec_work(:) = idx_sec(ii:ii + num_mults - 1)
902 eigvec_entries_work(:) = eigvec_entries(ii:ii + num_mults - 1)
903 ALLOCATE (tmp_index(num_mults))
904 CALL sort(idx_sec_work, num_mults, tmp_index)
907 DO kk = ii, ii + num_mults - 1
908 idx_sec(kk) = idx_sec_work(kk - ii + 1)
909 eigvec_entries(kk) = eigvec_entries_work(tmp_index(kk - ii + 1))
912 DEALLOCATE (tmp_index)
913 DEALLOCATE (idx_sec_work)
914 DEALLOCATE (eigvec_entries_work)
916 idx_prim_work(ii) = idx_prim(ii)
918 DEALLOCATE (idx_prim_work)
921 CALL timestop(handle)
935 para_env, diag_runtime_est)
937 INTEGER :: homo_red, virtual_red, unit_nr
940 REAL(kind=
dp) :: diag_runtime_est
942 CHARACTER(LEN=*),
PARAMETER :: routinen =
'estimate_BSE_resources'
944 INTEGER :: handle, num_bse_matrices
945 INTEGER(KIND=int_8) :: full_dim
946 REAL(kind=
dp) :: mem_est, mem_est_per_rank
948 CALL timeset(routinen, handle)
955 num_bse_matrices = 10
958 full_dim = (int(homo_red, kind=
int_8)**2*int(virtual_red, kind=
int_8)**2)*int(num_bse_matrices, kind=
int_8)
959 mem_est = real(8*full_dim, kind=
dp)/real(1024**3, kind=
dp)
960 mem_est_per_rank = real(mem_est/para_env%num_pe, kind=
dp)
962 IF (unit_nr > 0)
THEN
965 WRITE (unit_nr,
'(T2,A4,T7,A40,T68,ES13.3)')
'BSE|',
'Total peak memory estimate from BSE [GB]', &
967 WRITE (unit_nr,
'(T2,A4,T7,A47,T68,F13.3)')
'BSE|',
'Peak memory estimate per MPI rank from BSE [GB]', &
969 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
973 diag_runtime_est = real(int(homo_red, kind=
int_8)*int(virtual_red, kind=
int_8)/11000_int_8, kind=
dp)**3* &
974 10*32/real(para_env%num_pe, kind=
dp)
976 CALL timestop(handle)
993 i_exc, virtual, num_entries, mp2_env)
996 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: idx_homo, idx_virt
997 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigvec_entries
998 INTEGER :: i_exc, virtual, num_entries
999 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
1001 CHARACTER(LEN=*),
PARAMETER :: routinen =
'filter_eigvec_contrib'
1003 INTEGER :: eigvec_idx, handle, ii, iproc, jj, kk, &
1004 ncol_local, nrow_local, &
1006 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: num_entries_to_comm
1007 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
1008 REAL(kind=
dp) :: eigvec_entry
1010 DIMENSION(:) :: buffer_entries
1013 CALL timeset(routinen, handle)
1015 para_env => fm_eigvec%matrix_struct%para_env
1018 nrow_local=nrow_local, &
1019 ncol_local=ncol_local, &
1020 row_indices=row_indices, &
1021 col_indices=col_indices)
1023 ALLOCATE (num_entries_to_comm(0:para_env%num_pe - 1))
1024 num_entries_to_comm(:) = 0
1026 DO jj = 1, ncol_local
1028 IF (col_indices(jj) /= i_exc)
THEN
1031 DO ii = 1, nrow_local
1032 eigvec_idx = row_indices(ii)
1033 eigvec_entry = fm_eigvec%local_data(ii, jj)/sqrt(2.0_dp)
1034 IF (abs(eigvec_entry) > mp2_env%bse%eps_x)
THEN
1035 num_entries_to_comm(para_env%mepos) = num_entries_to_comm(para_env%mepos) + 1
1041 CALL para_env%sum(num_entries_to_comm)
1043 num_entries_local = num_entries_to_comm(para_env%mepos)
1045 ALLOCATE (buffer_entries(0:para_env%num_pe - 1))
1047 DO iproc = 0, para_env%num_pe - 1
1048 ALLOCATE (buffer_entries(iproc)%msg(num_entries_to_comm(iproc)))
1049 ALLOCATE (buffer_entries(iproc)%indx(num_entries_to_comm(iproc), 2))
1050 buffer_entries(iproc)%msg = 0.0_dp
1051 buffer_entries(iproc)%indx = 0
1055 DO jj = 1, ncol_local
1057 IF (col_indices(jj) /= i_exc)
THEN
1060 DO ii = 1, nrow_local
1061 eigvec_idx = row_indices(ii)
1062 eigvec_entry = fm_eigvec%local_data(ii, jj)/sqrt(2.0_dp)
1063 IF (abs(eigvec_entry) > mp2_env%bse%eps_x)
THEN
1064 buffer_entries(para_env%mepos)%indx(kk, 1) = (eigvec_idx - 1)/virtual + 1
1065 buffer_entries(para_env%mepos)%indx(kk, 2) = mod(eigvec_idx - 1, virtual) + 1
1066 buffer_entries(para_env%mepos)%msg(kk) = eigvec_entry
1072 DO iproc = 0, para_env%num_pe - 1
1073 CALL para_env%sum(buffer_entries(iproc)%msg)
1074 CALL para_env%sum(buffer_entries(iproc)%indx)
1078 num_entries = sum(num_entries_to_comm)
1079 ALLOCATE (idx_homo(num_entries))
1080 ALLOCATE (idx_virt(num_entries))
1081 ALLOCATE (eigvec_entries(num_entries))
1084 DO iproc = 0, para_env%num_pe - 1
1085 IF (num_entries_to_comm(iproc) /= 0)
THEN
1086 DO ii = 1, num_entries_to_comm(iproc)
1087 idx_homo(kk) = buffer_entries(iproc)%indx(ii, 1)
1088 idx_virt(kk) = buffer_entries(iproc)%indx(ii, 2)
1089 eigvec_entries(kk) = buffer_entries(iproc)%msg(ii)
1096 DO iproc = 0, para_env%num_pe - 1
1097 DEALLOCATE (buffer_entries(iproc)%msg)
1098 DEALLOCATE (buffer_entries(iproc)%indx)
1100 DEALLOCATE (buffer_entries)
1101 DEALLOCATE (num_entries_to_comm)
1102 NULLIFY (row_indices)
1103 NULLIFY (col_indices)
1109 CALL timestop(handle)
1127 homo_red, virt_red, &
1128 homo_incl, virt_incl, &
1131 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: eigenval
1132 INTEGER,
INTENT(IN) :: homo, virtual
1133 INTEGER,
INTENT(OUT) :: homo_red, virt_red, homo_incl, virt_incl
1134 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
1136 CHARACTER(LEN=*),
PARAMETER :: routinen =
'determine_cutoff_indices'
1138 INTEGER :: handle, i_homo, j_virt
1140 CALL timeset(routinen, handle)
1143 IF (mp2_env%bse%bse_cutoff_occ > 0 .OR. mp2_env%bse%bse_cutoff_empty > 0)
THEN
1144 IF (-mp2_env%bse%bse_cutoff_occ .LT. eigenval(1) - eigenval(homo) &
1145 .OR. mp2_env%bse%bse_cutoff_occ < 0)
THEN
1151 IF (eigenval(i_homo) - eigenval(homo) .GT. -mp2_env%bse%bse_cutoff_occ)
THEN
1156 homo_red = homo - homo_incl + 1
1159 IF (mp2_env%bse%bse_cutoff_empty .GT. eigenval(homo + virtual) - eigenval(homo + 1) &
1160 .OR. mp2_env%bse%bse_cutoff_empty < 0)
THEN
1164 virt_incl = homo + 1
1165 DO j_virt = 1, virtual
1166 IF (eigenval(homo + j_virt) - eigenval(homo + 1) .GT. mp2_env%bse%bse_cutoff_empty)
THEN
1167 virt_incl = j_virt - 1
1171 virt_red = virt_incl
1180 CALL timestop(handle)
1205 fm_mat_S_trunc, fm_mat_S_ij_trunc, fm_mat_S_ab_trunc, &
1206 Eigenval_scf, Eigenval, Eigenval_reduced, &
1207 homo, virtual, dimen_RI, unit_nr, &
1209 homo_red, virt_red, &
1212 TYPE(
cp_fm_type),
INTENT(IN) :: fm_mat_s_ia_bse, fm_mat_s_ij_bse, &
1214 TYPE(
cp_fm_type),
INTENT(INOUT) :: fm_mat_s_trunc, fm_mat_s_ij_trunc, &
1216 REAL(kind=
dp),
DIMENSION(:) :: eigenval_scf, eigenval
1217 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: eigenval_reduced
1218 INTEGER,
INTENT(IN) :: homo, virtual, dimen_ri, unit_nr, &
1220 INTEGER,
INTENT(OUT) :: homo_red, virt_red
1221 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
1223 CHARACTER(LEN=*),
PARAMETER :: routinen =
'truncate_BSE_matrices'
1225 INTEGER :: handle, homo_incl, virt_incl
1230 CALL timeset(routinen, handle)
1237 homo_red, virt_red, &
1238 homo_incl, virt_incl, &
1241 IF (unit_nr > 0)
THEN
1242 IF (mp2_env%bse%bse_cutoff_occ > 0)
THEN
1243 WRITE (unit_nr,
'(T2,A4,T7,A29,T71,F10.3)')
'BSE|',
'Cutoff occupied orbitals [eV]', &
1244 mp2_env%bse%bse_cutoff_occ*
evolt
1246 WRITE (unit_nr,
'(T2,A4,T7,A37)')
'BSE|',
'No cutoff given for occupied orbitals'
1248 IF (mp2_env%bse%bse_cutoff_empty > 0)
THEN
1249 WRITE (unit_nr,
'(T2,A4,T7,A26,T71,F10.3)')
'BSE|',
'Cutoff empty orbitals [eV]', &
1250 mp2_env%bse%bse_cutoff_empty*
evolt
1252 WRITE (unit_nr,
'(T2,A4,T7,A34)')
'BSE|',
'No cutoff given for empty orbitals'
1254 WRITE (unit_nr,
'(T2,A4,T7,A20,T71,I10)')
'BSE|',
'First occupied index', homo_incl
1255 WRITE (unit_nr,
'(T2,A4,T7,A32,T71,I10)')
'BSE|',
'Last empty index (not MO index!)', virt_incl
1256 WRITE (unit_nr,
'(T2,A4,T7,A35,T71,F10.3)')
'BSE|',
'Energy of first occupied index [eV]', eigenval(homo_incl)*
evolt
1257 WRITE (unit_nr,
'(T2,A4,T7,A31,T71,F10.3)')
'BSE|',
'Energy of last empty index [eV]', eigenval(homo + virt_incl)*
evolt
1258 WRITE (unit_nr,
'(T2,A4,T7,A54,T71,F10.3)')
'BSE|',
'Energy difference of first occupied index to HOMO [eV]', &
1259 -(eigenval(homo_incl) - eigenval(homo))*
evolt
1260 WRITE (unit_nr,
'(T2,A4,T7,A50,T71,F10.3)')
'BSE|',
'Energy difference of last empty index to LUMO [eV]', &
1261 (eigenval(homo + virt_incl) - eigenval(homo + 1))*
evolt
1262 WRITE (unit_nr,
'(T2,A4,T7,A35,T71,I10)')
'BSE|',
'Number of GW-corrected occupied MOs', mp2_env%ri_g0w0%corr_mos_occ
1263 WRITE (unit_nr,
'(T2,A4,T7,A32,T71,I10)')
'BSE|',
'Number of GW-corrected empty MOs', mp2_env%ri_g0w0%corr_mos_virt
1264 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
1266 IF (unit_nr > 0)
THEN
1267 IF (homo - homo_incl + 1 > mp2_env%ri_g0w0%corr_mos_occ)
THEN
1268 cpabort(
"Number of GW-corrected occupied MOs too small for chosen BSE cutoff")
1270 IF (virt_incl > mp2_env%ri_g0w0%corr_mos_virt)
THEN
1271 cpabort(
"Number of GW-corrected virtual MOs too small for chosen BSE cutoff")
1276 para_env => fm_mat_s_ia_bse%matrix_struct%para_env
1277 context => fm_mat_s_ia_bse%matrix_struct%context
1283 CALL cp_fm_create(fm_mat_s_trunc, fm_struct_ia,
"fm_S_trunc")
1284 CALL cp_fm_create(fm_mat_s_ij_trunc, fm_struct_ij,
"fm_S_ij_trunc")
1285 CALL cp_fm_create(fm_mat_s_ab_trunc, fm_struct_ab,
"fm_S_ab_trunc")
1288 IF (mp2_env%bse%bse_cutoff_occ > 0 .OR. mp2_env%bse%bse_cutoff_empty > 0)
THEN
1290 ALLOCATE (eigenval_reduced(homo_red + virt_red))
1292 IF (mp2_env%bse%use_ks_energies)
THEN
1293 eigenval_reduced(:) = eigenval_scf(homo_incl:homo + virt_incl)
1295 eigenval_reduced(:) = eigenval(homo_incl:homo + virt_incl)
1298 CALL truncate_fm(fm_mat_s_trunc, fm_mat_s_ia_bse, virtual, &
1299 homo_red, virt_red, unit_nr, mp2_env, &
1300 nrow_offset=homo_incl)
1301 CALL truncate_fm(fm_mat_s_ij_trunc, fm_mat_s_ij_bse, homo, &
1302 homo_red, homo_red, unit_nr, mp2_env, &
1303 homo_incl, homo_incl)
1304 CALL truncate_fm(fm_mat_s_ab_trunc, fm_mat_s_ab_bse, bse_lev_virt, &
1305 virt_red, virt_red, unit_nr, mp2_env)
1308 IF (unit_nr > 0)
THEN
1309 WRITE (unit_nr,
'(T2,A4,T7,A37)')
'BSE|',
'No truncation of BSE matrices applied'
1310 WRITE (unit_nr,
'(T2,A4)')
'BSE|'
1312 ALLOCATE (eigenval_reduced(homo_red + virt_red))
1314 IF (mp2_env%bse%use_ks_energies)
THEN
1315 eigenval_reduced(:) = eigenval_scf(:)
1317 eigenval_reduced(:) = eigenval(:)
1320 1, 1, 1, 1, context)
1322 1, 1, 1, 1, context)
1324 1, 1, 1, 1, context)
1334 CALL timestop(handle)
1349 SUBROUTINE reshuffle_eigvec(fm_eigvec, fm_eigvec_reshuffled, homo, virtual, n_exc, do_transpose, &
1353 TYPE(
cp_fm_type),
INTENT(INOUT) :: fm_eigvec_reshuffled
1354 INTEGER,
INTENT(IN) :: homo, virtual, n_exc
1355 LOGICAL,
INTENT(IN) :: do_transpose
1356 INTEGER,
INTENT(IN) :: unit_nr
1357 TYPE(
mp2_type),
INTENT(INOUT) :: mp2_env
1359 CHARACTER(LEN=*),
PARAMETER :: routinen =
'reshuffle_eigvec'
1361 INTEGER :: handle, my_m_col, my_n_row
1362 INTEGER,
DIMENSION(4) :: reordering
1364 fm_struct_eigvec_reshuffled
1367 CALL timeset(routinen, handle)
1372 IF (do_transpose)
THEN
1373 reordering = (/2, 3, 1, 4/)
1377 reordering = (/1, 3, 2, 4/)
1383 fm_eigvec%matrix_struct%para_env, fm_eigvec%matrix_struct%context, &
1386 fm_eigvec%matrix_struct%para_env, fm_eigvec%matrix_struct%context, &
1390 CALL cp_fm_create(fm_eigvec_col, fm_struct_eigvec_col, name=
"BSE_column_vector")
1392 CALL cp_fm_create(fm_eigvec_reshuffled, fm_struct_eigvec_reshuffled, name=
"BSE_reshuffled_eigenvector")
1403 unit_nr, reordering, mp2_env)
1409 CALL timestop(handle)
1424 stride, append_cube, print_section)
1427 TYPE(
mo_set_type),
DIMENSION(:),
INTENT(IN) :: mos
1428 INTEGER,
INTENT(IN) :: istate
1429 CHARACTER(LEN=10) :: info_approximation
1430 INTEGER,
DIMENSION(:),
POINTER :: stride
1431 LOGICAL,
INTENT(IN) :: append_cube
1434 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_bse_nto_cubes'
1436 CHARACTER(LEN=default_path_length) :: filename, info_approx_trunc, &
1438 INTEGER :: handle, i, iset, nmo, unit_nr_cube
1452 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
1456 CALL timeset(routinen, handle)
1458 CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, pw_env=pw_env)
1459 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools)
1460 CALL auxbas_pw_pool%create_pw(wf_r)
1461 CALL auxbas_pw_pool%create_pw(wf_g)
1466 my_pos_cube =
"REWIND"
1467 IF (append_cube)
THEN
1468 my_pos_cube =
"APPEND"
1472 atomic_kind_set=atomic_kind_set, &
1473 qs_kind_set=qs_kind_set, &
1475 particle_set=particle_set)
1478 CALL get_mo_set(mo_set=mos(iset), mo_coeff=mo_coeff, nmo=nmo)
1481 cell, dft_control, particle_set, pw_env)
1483 WRITE (filename,
'(A6,I3.3,A5,I2.2,a11)')
"_NEXC_", istate,
"_NTO_", i,
"_Hole_State"
1484 ELSEIF (iset == 2)
THEN
1485 WRITE (filename,
'(A6,I3.3,A5,I2.2,a15)')
"_NEXC_", istate,
"_NTO_", i,
"_Particle_State"
1487 info_approx_trunc = trim(adjustl(info_approximation))
1488 info_approx_trunc = info_approx_trunc(2:len_trim(info_approx_trunc) - 1)
1489 filename = trim(info_approx_trunc)//trim(filename)
1492 middle_name=trim(filename), file_position=my_pos_cube, &
1493 log_filename=.false., ignore_should_output=.true., mpi_io=mpi_io)
1495 WRITE (title, *)
"Natural Transition Orbital Hole State", i
1496 ELSEIF (iset == 2)
THEN
1497 WRITE (title, *)
"Natural Transition Orbital Particle State", i
1499 CALL cp_pw_to_cube(wf_r, unit_nr_cube, title, particles=particles, stride=stride, mpi_io=mpi_io)
1501 ignore_should_output=.true., mpi_io=mpi_io)
1505 CALL auxbas_pw_pool%give_back_pw(wf_g)
1506 CALL auxbas_pw_pool%give_back_pw(wf_r)
1508 CALL timestop(handle)
1521 INTEGER,
INTENT(IN) :: homo, virtual, unit_nr
1525 CHARACTER(LEN=*),
PARAMETER :: routinen =
'adapt_BSE_input_params'
1527 INTEGER :: handle, i, j, n, ndim_periodic_cell, &
1528 ndim_periodic_poisson, &
1529 num_state_list_exceptions
1534 CALL timeset(routinen, handle)
1536 NULLIFY (pw_env, cell_ref, poisson_env)
1537 CALL get_qs_env(qs_env, pw_env=pw_env, cell_ref=cell_ref)
1538 CALL pw_env_get(pw_env, poisson_env=poisson_env)
1539 ndim_periodic_poisson = count(poisson_env%parameters%periodic == 1)
1540 ndim_periodic_cell = sum(cell_ref%perd(1:3))
1543 IF (mp2_env%bse%num_print_exc < 0 .OR. &
1544 mp2_env%bse%num_print_exc > homo*virtual)
THEN
1545 mp2_env%bse%num_print_exc = homo*virtual
1546 IF (unit_nr > 0)
THEN
1547 CALL cp_hint(__location__, &
1548 "Keyword NUM_PRINT_EXC is either negative or too large. "// &
1549 "Printing all computed excitations.")
1559 IF (mp2_env%bse%do_nto_analysis)
THEN
1560 IF (mp2_env%bse%explicit_nto_list)
THEN
1561 IF (mp2_env%bse%num_print_exc_ntos > 0)
THEN
1562 IF (unit_nr > 0)
THEN
1563 CALL cp_hint(__location__, &
1564 "Keywords NUM_PRINT_EXC_NTOS and STATE_LIST are both given in input. "// &
1565 "Overriding NUM_PRINT_EXC_NTOS.")
1570 num_state_list_exceptions = 0
1571 DO i = 1,
SIZE(mp2_env%bse%bse_nto_state_list)
1572 IF (mp2_env%bse%bse_nto_state_list(i) < 1 .OR. &
1573 mp2_env%bse%bse_nto_state_list(i) > mp2_env%bse%num_print_exc)
THEN
1574 num_state_list_exceptions = num_state_list_exceptions + 1
1577 IF (num_state_list_exceptions > 0)
THEN
1578 IF (unit_nr > 0)
THEN
1579 CALL cp_hint(__location__, &
1580 "STATE_LIST contains indices outside the range of included excitation levels. "// &
1581 "Ignoring these states.")
1584 n =
SIZE(mp2_env%bse%bse_nto_state_list) - num_state_list_exceptions
1585 ALLOCATE (mp2_env%bse%bse_nto_state_list_final(n))
1586 mp2_env%bse%bse_nto_state_list_final(:) = 0
1588 DO j = 1,
SIZE(mp2_env%bse%bse_nto_state_list)
1589 IF (mp2_env%bse%bse_nto_state_list(j) >= 1 .AND. &
1590 mp2_env%bse%bse_nto_state_list(j) <= mp2_env%bse%num_print_exc)
THEN
1591 mp2_env%bse%bse_nto_state_list_final(i) = mp2_env%bse%bse_nto_state_list(j)
1596 mp2_env%bse%num_print_exc_ntos =
SIZE(mp2_env%bse%bse_nto_state_list_final)
1598 IF (mp2_env%bse%num_print_exc_ntos > mp2_env%bse%num_print_exc .OR. &
1599 mp2_env%bse%num_print_exc_ntos < 0)
THEN
1600 mp2_env%bse%num_print_exc_ntos = mp2_env%bse%num_print_exc
1602 ALLOCATE (mp2_env%bse%bse_nto_state_list_final(mp2_env%bse%num_print_exc_ntos))
1603 DO i = 1, mp2_env%bse%num_print_exc_ntos
1604 mp2_env%bse%bse_nto_state_list_final(i) = i
1610 IF (mp2_env%bse%bse_spin_config /= 0 .AND. &
1611 mp2_env%bse%eps_nto_osc_str > 0)
THEN
1612 IF (unit_nr > 0)
THEN
1613 CALL cp_warn(__location__, &
1614 "Cannot apply EPS_OSC_STR for Triplet excitations. "// &
1615 "Resetting EPS_OSC_STR to default.")
1617 mp2_env%bse%eps_nto_osc_str = -1.0_dp
1621 IF (mp2_env%bse%num_print_exc_descr < 0 .OR. &
1622 mp2_env%bse%num_print_exc_descr > mp2_env%bse%num_print_exc)
THEN
1623 IF (unit_nr > 0)
THEN
1624 CALL cp_hint(__location__, &
1625 "Keyword NUM_PRINT_EXC_DESCR is either negative or too large. "// &
1626 "Printing exciton descriptors up to NUM_PRINT_EXC.")
1628 mp2_env%bse%num_print_exc_descr = mp2_env%bse%num_print_exc
1632 IF (mp2_env%BSE%screening_factor > 0.0_dp)
THEN
1634 IF (unit_nr > 0)
THEN
1635 CALL cp_warn(__location__, &
1636 "Screening factor is only supported for &SCREENING_IN_W ALPHA. "// &
1637 "Resetting SCREENING_IN_W to ALPHA.")
1641 IF (mp2_env%BSE%screening_factor > 1.0_dp)
THEN
1642 IF (unit_nr > 0)
THEN
1643 CALL cp_warn(__location__, &
1644 "Screening factor is larger than 1.0. ")
1649 IF (mp2_env%BSE%screening_factor < 0.0_dp .AND. &
1651 IF (unit_nr > 0)
THEN
1652 CALL cp_warn(__location__, &
1653 "Screening factor is negative. Defaulting to 0.25")
1655 mp2_env%BSE%screening_factor = 0.25_dp
1658 IF (mp2_env%BSE%screening_factor == 0.0_dp)
THEN
1662 IF (mp2_env%BSE%screening_factor == 1.0_dp)
THEN
1668 IF (mp2_env%bse%use_ks_energies)
THEN
1669 IF (unit_nr > 0)
THEN
1670 CALL cp_warn(__location__, &
1671 "Using KS energies for BSE calculations. Therefore, no quantities "// &
1672 "of the preceeding GW calculation enter the BSE.")
1677 IF (ndim_periodic_poisson /= 0)
THEN
1678 IF (unit_nr > 0)
THEN
1679 CALL cp_warn(__location__, &
1680 "Poisson solver should be invoked by PERIODIC NONE. "// &
1681 "The applied length gauge might give misleading results for "// &
1682 "oscillator strengths.")
1685 IF (ndim_periodic_cell /= 0)
THEN
1686 IF (unit_nr > 0)
THEN
1687 CALL cp_warn(__location__, &
1688 "CELL in SUBSYS should be invoked with PERIODIC NONE. "// &
1689 "The applied length gauge might give misleading results for "// &
1690 "oscillator strengths.")
1694 CALL timestop(handle)
1713 qs_env, mo_coeff, rpoint, n_moments, &
1714 homo_red, virtual_red, context_BSE)
1716 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:), &
1717 INTENT(INOUT) :: fm_multipole_ai_trunc, &
1718 fm_multipole_ij_trunc, &
1719 fm_multipole_ab_trunc
1721 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(IN) :: mo_coeff
1722 REAL(
dp),
ALLOCATABLE,
DIMENSION(:),
INTENT(INOUT) :: rpoint
1723 INTEGER,
INTENT(IN) :: n_moments, homo_red, virtual_red
1726 CHARACTER(LEN=*),
PARAMETER :: routinen =
'get_multipoles_mo'
1728 INTEGER :: handle, idir, n_multipole, n_occ, &
1729 n_virt, nao, nmo_mp2
1730 REAL(kind=
dp),
DIMENSION(:),
POINTER :: ref_point
1731 TYPE(
cp_fm_struct_type),
POINTER :: fm_struct_mp_ab_trunc, fm_struct_mp_ai_trunc, &
1732 fm_struct_mp_ij_trunc, fm_struct_multipoles_ao, fm_struct_nao_nmo, fm_struct_nmo_nmo
1734 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: fm_multipole_per_dir
1735 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_multipole, matrix_s
1741 CALL timeset(routinen, handle)
1744 NULLIFY (sab_orb, matrix_s)
1747 matrix_s=matrix_s, &
1751 fm_struct_multipoles_ao => mos(1)%mo_coeff%matrix_struct
1753 para_env_bse => context_bse%para_env
1755 n_multipole = (6 + 11*n_moments + 6*n_moments**2 + n_moments**3)/6 - 1
1756 NULLIFY (matrix_multipole)
1758 ALLOCATE (fm_multipole_per_dir(n_multipole))
1759 DO idir = 1, n_multipole
1761 CALL dbcsr_create(matrix_multipole(idir)%matrix, name=
"ao_multipole", &
1762 template=matrix_s(1)%matrix, matrix_type=dbcsr_type_symmetric)
1764 CALL dbcsr_set(matrix_multipole(idir)%matrix, 0._dp)
1777 CALL get_mo_set(mo_set=mos(1), homo=n_occ, nao=nao)
1779 nmo_mp2 = mo_coeff(1)%matrix_struct%ncol_global
1780 n_virt = nmo_mp2 - n_occ
1793 fm_struct_multipoles_ao%para_env, fm_struct_multipoles_ao%context, &
1796 fm_struct_multipoles_ao%para_env, fm_struct_multipoles_ao%context, &
1801 context_bse, virtual_red, homo_red)
1803 context_bse, homo_red, homo_red)
1805 context_bse, virtual_red, virtual_red)
1806 DO idir = 1, n_multipole
1807 CALL cp_fm_create(fm_multipole_ai_trunc(idir), matrix_struct=fm_struct_mp_ai_trunc, &
1808 name=
"dipoles_mo_ai_trunc")
1810 CALL cp_fm_create(fm_multipole_ij_trunc(idir), matrix_struct=fm_struct_mp_ij_trunc, &
1811 name=
"dipoles_mo_ij_trunc")
1813 CALL cp_fm_create(fm_multipole_ab_trunc(idir), matrix_struct=fm_struct_mp_ab_trunc, &
1814 name=
"dipoles_mo_ab_trunc")
1820 CALL cp_fm_create(fm_work, matrix_struct=fm_struct_nao_nmo, name=
"multipole_work")
1823 DO idir = 1, n_multipole
1825 CALL cp_fm_create(fm_multipole_per_dir(idir), matrix_struct=fm_struct_nmo_nmo, name=
"multipoles_mo")
1829 fm_work, ncol=nmo_mp2)
1832 CALL parallel_gemm(
'T',
'N', nmo_mp2, nmo_mp2, nao, 1.0_dp, mo_coeff(1), fm_work, 0.0_dp, fm_multipole_per_dir(idir))
1837 fm_multipole_ai_trunc(idir), &
1841 n_occ - homo_red + 1, &
1844 fm_multipole_per_dir(idir)%matrix_struct%context)
1847 fm_multipole_ij_trunc(idir), &
1850 n_occ - homo_red + 1, &
1851 n_occ - homo_red + 1, &
1854 fm_multipole_per_dir(idir)%matrix_struct%context)
1857 fm_multipole_ab_trunc(idir), &
1864 fm_multipole_per_dir(idir)%matrix_struct%context)
1868 NULLIFY (fm_struct_multipoles_ao)
1874 DO idir = 1, n_multipole
1877 DEALLOCATE (fm_multipole_per_dir)
1881 CALL timestop(handle)
1894 TYPE(
cp_fm_type),
INTENT(IN) :: fm_a, fm_b, fm_c
1895 REAL(kind=
dp),
INTENT(OUT) :: alpha
1897 CHARACTER(LEN=*),
PARAMETER :: routinen =
'trace_exciton_descr'
1899 INTEGER :: handle, ncol_a, ncol_b, ncol_c, nrow_a, &
1903 CALL timeset(routinen, handle)
1906 CALL cp_fm_get_info(fm_a, nrow_global=nrow_a, ncol_global=ncol_a)
1907 CALL cp_fm_get_info(fm_b, nrow_global=nrow_b, ncol_global=ncol_b)
1908 CALL cp_fm_get_info(fm_c, nrow_global=nrow_c, ncol_global=ncol_c)
1911 cpassert(nrow_a == nrow_b .AND. ncol_a == ncol_c .AND. ncol_b == nrow_c)
1915 CALL parallel_gemm(
"N",
"N", nrow_a, ncol_a, nrow_c, 1.0_dp, &
1916 fm_b, fm_c, 0.0_dp, fm_work_ia)
1922 CALL timestop(handle)
Define the atomic kind types and their sub types.
Auxiliary routines for GW + Bethe-Salpeter for computing electronic excitations.
subroutine, public filter_eigvec_contrib(fm_eigvec, idx_homo, idx_virt, eigvec_entries, i_exc, virtual, num_entries, mp2_env)
Filters eigenvector entries above a given threshold to describe excitations in the singleparticle bas...
subroutine, public get_multipoles_mo(fm_multipole_ai_trunc, fm_multipole_ij_trunc, fm_multipole_ab_trunc, qs_env, mo_coeff, rpoint, n_moments, homo_red, virtual_red, context_bse)
...
subroutine, public trace_exciton_descr(fm_a, fm_b, fm_c, alpha)
Computes trace of form Tr{A^T B C} for exciton descriptors.
subroutine, public determine_cutoff_indices(eigenval, homo, virtual, homo_red, virt_red, homo_incl, virt_incl, mp2_env)
Reads cutoffs for BSE from mp2_env and compares to energies in Eigenval to extract reduced homo/virtu...
subroutine, public estimate_bse_resources(homo_red, virtual_red, unit_nr, bse_abba, para_env, diag_runtime_est)
Roughly estimates the needed runtime and memory during the BSE run.
subroutine, public truncate_fm(fm_out, fm_in, ncol_in, nrow_out, ncol_out, unit_nr, mp2_env, nrow_offset, ncol_offset)
Routine for truncating a full matrix as given by the energy cutoffs in the input file....
subroutine, public deallocate_matrices_bse(fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse, fm_mat_s_trunc, fm_mat_s_ij_trunc, fm_mat_s_ab_trunc, fm_mat_q_static_bse_gemm, mp2_env)
...
subroutine, public reshuffle_eigvec(fm_eigvec, fm_eigvec_reshuffled, homo, virtual, n_exc, do_transpose, unit_nr, mp2_env)
...
subroutine, public mult_b_with_w(fm_mat_s_ij_bse, fm_mat_s_ia_bse, fm_mat_s_bar_ia_bse, fm_mat_s_bar_ij_bse, fm_mat_q_static_bse_gemm, dimen_ri, homo, virtual)
Multiplies B-matrix (RI-3c-Integrals) with W (screening) to obtain \bar{B}.
subroutine, public adapt_bse_input_params(homo, virtual, unit_nr, mp2_env, qs_env)
Checks BSE input section and adapts them if necessary.
subroutine, public truncate_bse_matrices(fm_mat_s_ia_bse, fm_mat_s_ij_bse, fm_mat_s_ab_bse, fm_mat_s_trunc, fm_mat_s_ij_trunc, fm_mat_s_ab_trunc, eigenval_scf, eigenval, eigenval_reduced, homo, virtual, dimen_ri, unit_nr, bse_lev_virt, homo_red, virt_red, mp2_env)
Determines indices within the given energy cutoffs and truncates Eigenvalues and matrices.
subroutine, public comp_eigvec_coeff_bse(fm_work, eig_vals, beta, gamma, do_transpose)
Routine for computing the coefficients of the eigenvectors of the BSE matrix from a multiplication wi...
subroutine, public print_bse_nto_cubes(qs_env, mos, istate, info_approximation, stride, append_cube, print_section)
Borrowed from the tddfpt module with slight adaptions.
subroutine, public fm_general_add_bse(fm_out, fm_in, beta, nrow_secidx_in, ncol_secidx_in, nrow_secidx_out, ncol_secidx_out, unit_nr, reordering, mp2_env)
Adds and reorders full matrices with a combined index structure, e.g. adding W_ij,...
subroutine, public sort_excitations(idx_prim, idx_sec, eigvec_entries)
...
Handles all functions related to the CELL.
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_init_p(matrix)
...
subroutine, public dbcsr_set(matrix, alpha)
...
Routines that link DBCSR and CP2K concepts together.
subroutine, public cp_dbcsr_alloc_block_from_nbl(matrix, sab_orb, desymmetrize)
allocate the blocks of a dbcsr based on the neighbor list
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
basic linear algebra operations for full matrices
subroutine, public cp_fm_uplo_to_full(matrix, work, uplo)
given a triangular matrix according to uplo, computes the corresponding full matrix
various cholesky decomposition related routines
subroutine, public cp_fm_cholesky_invert(matrix, n, info_out)
used to replace the cholesky decomposition by the inverse
subroutine, public cp_fm_cholesky_decompose(matrix, n, info_out)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
represent a full matrix distributed on many processors
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_to_fm_submat_general(source, destination, nrows, ncols, s_firstrow, s_firstcol, d_firstrow, d_firstcol, global_context)
General copy of a submatrix of fm matrix to a submatrix of another fm matrix. The two matrices can ha...
subroutine, public cp_fm_to_fm_submat(msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol)
copy just a part ot the matrix
subroutine, public cp_fm_set_all(matrix, alpha, beta)
set all elements of a matrix to the same value, and optionally the diagonal to a different one
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_pw_to_cube(pw, unit_nr, title, particles, stride, zero_tails, silent, mpi_io)
...
Calculation of the incomplete Gamma function F_n(t) for multi-center integrals over Cartesian Gaussia...
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
integer, parameter, public default_path_length
Interface to the message passing library MPI.
Calculates the moment integrals <a|r^m|b>
subroutine, public get_reference_point(rpoint, drpoint, qs_env, fist_env, reference, ref_point, ifirst, ilast)
...
Types needed for MP2 calculations.
basic linear algebra operations for full matrixes
represent a simple array based list of the given type
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
functions related to the poisson solver on regular grids
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Calculate the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public calculate_wavefunction(mo_vectors, ivector, rho, rho_gspace, atomic_kind_set, qs_kind_set, cell, dft_control, particle_set, pw_env, basis_type)
maps a given wavefunction on the grid
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
Definition and initialisation of the mo data type.
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kts, mu, flexible_electron_count)
Get the components of a MO set data structure.
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>
subroutine, public build_local_moment_matrix(qs_env, moments, nmoments, ref_point, ref_points, basis_type)
...
Define the neighbor list data types and the corresponding functionality.
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
Auxiliary routines necessary to redistribute an fm_matrix from a given blacs_env to another.
subroutine, public communicate_buffer(para_env, num_entries_rec, num_entries_send, buffer_rec, buffer_send, req_array, do_indx, do_msg)
...
All kind of helpful little routines.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
represent a blacs multidimensional parallel environment (for the mpi corrispective see cp_paratypes/m...
keeps the information about the structure of a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
represent a list of objects
contained for different pw related things
environment for the poisson solver
to create arrays of pools
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Provides all information about a quickstep kind.