Skip to content

Commit

Permalink
XAS_TDP| Added EPS_PGF_XAS keyword to define basis function radii
Browse files Browse the repository at this point in the history
independently from ground state calculation.
  • Loading branch information
abussy authored and pseewald committed Oct 9, 2019
1 parent cf644c8 commit a957e65
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 44 deletions.
4 changes: 4 additions & 0 deletions src/auto_basis.F
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MODULE auto_basis
gamma1,& gamma1,&
pi,& pi,&
rootpi rootpi
USE orbital_pointers, ONLY: init_orbital_pointers
USE periodic_table, ONLY: get_ptable_info USE periodic_table, ONLY: get_ptable_info
USE powell, ONLY: opt_state_type,& USE powell, ONLY: opt_state_type,&
powell_optimize powell_optimize
Expand Down Expand Up @@ -84,6 +85,9 @@ SUBROUTINE create_ri_aux_basis_set(ri_aux_basis_set, qs_kind, basis_cntrl)
CALL get_qs_kind(qs_kind, basis_set=orb_basis_set, basis_type="ORB") CALL get_qs_kind(qs_kind, basis_set=orb_basis_set, basis_type="ORB")
IF (ASSOCIATED(orb_basis_set)) THEN IF (ASSOCIATED(orb_basis_set)) THEN
CALL get_basis_keyfigures(orb_basis_set, lmax, zmin, zmax, zeff) CALL get_basis_keyfigures(orb_basis_set, lmax, zmin, zmax, zeff)
!Note: RI basis coud require lmax up to 2*orb_lmax. This ensures that all orbital pointers
! are properly initialized before building the basis
CALL init_orbital_pointers(2*lmax)
CALL get_basis_products(lmax, zmin, zmax, zeff, pmin, pmax, peff) CALL get_basis_products(lmax, zmin, zmax, zeff, pmin, pmax, peff)
CALL get_qs_kind(qs_kind, zeff=zval, elec_conf=econf, element_symbol=element_symbol) CALL get_qs_kind(qs_kind, zeff=zval, elec_conf=econf, element_symbol=element_symbol)
CALL get_ptable_info(element_symbol, ielement=z) CALL get_ptable_info(element_symbol, ielement=z)
Expand Down
17 changes: 15 additions & 2 deletions src/input_cp2k_dft.F
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7888,7 +7888,7 @@ SUBROUTINE create_xas_tdp_section(section)
description="XAS simulations using linear-response TDDFT. Excitation from "// & description="XAS simulations using linear-response TDDFT. Excitation from "// &
"specified core orbitals are considered one at a time. In case of high "// & "specified core orbitals are considered one at a time. In case of high "// &
"symmetry structures, donor core orbitals should be localized.", & "symmetry structures, donor core orbitals should be localized.", &
n_keywords=12, n_subsections=4, repeats=.FALSE.) n_keywords=13, n_subsections=4, repeats=.FALSE.)


NULLIFY (keyword, subsection, print_key) NULLIFY (keyword, subsection, print_key)


Expand Down Expand Up @@ -7945,6 +7945,19 @@ SUBROUTINE create_xas_tdp_section(section)
CALL section_add_keyword(section, keyword) CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword) CALL keyword_release(keyword)


CALL keyword_create(keyword, __LOCATION__, name="EPS_PGF_XAS", &
variants=s2a("EPS_PGF", "EPS_PGF_XAS_TDP"), &
description="The threshold used to determine the spacial extent of all "// &
"primitive Gaussian functions used for the construction "// &
"of neighbor lists in the XAS_TDP method. "// &
"By default, takes the value of QS%EPS_PGF_ORB. Useful if "// &
"the former value is tiny due to possible ground state HFX "// &
"contributions.", &
usage="EPS_PGS_XAS {real}", &
type_of_var=real_t)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", & CALL keyword_create(keyword, __LOCATION__, name="DIPOLE_FORM", &
variants=(/"DIP_FORM"/), & variants=(/"DIP_FORM"/), &
description="Type of integral to get the oscillator strengths "// & description="Type of integral to get the oscillator strengths "// &
Expand Down Expand Up @@ -8272,7 +8285,7 @@ SUBROUTINE create_xas_tdp_section(section)
"are kept for contraction, as the latter operation can be "// & "are kept for contraction, as the latter operation can be "// &
"expensive (especially for large basis sets )."// & "expensive (especially for large basis sets )."// &
"If |(ab|c)| < EPS_SCREENNING, it is discarded.", & "If |(ab|c)| < EPS_SCREENNING, it is discarded.", &
default_r_val=0.0_dp, & default_r_val=1.0E-10_dp, &
repeats=.FALSE.) repeats=.FALSE.)
CALL section_add_keyword(subsubsection, keyword) CALL section_add_keyword(subsubsection, keyword)
CALL keyword_release(keyword) CALL keyword_release(keyword)
Expand Down
4 changes: 1 addition & 3 deletions src/qs_environment.F
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -803,9 +803,7 @@ SUBROUTINE qs_init_subsys(qs_env, para_env, subsys, cell, cell_ref, use_ref_cell
IF (.NOT. ASSOCIATED(ri_xas_basis)) THEN IF (.NOT. ASSOCIATED(ri_xas_basis)) THEN
CALL cp_warn(__LOCATION__, "Automatic Generation of RI_XAS basis. "// & CALL cp_warn(__LOCATION__, "Automatic Generation of RI_XAS basis. "// &
"This is experimental code.") "This is experimental code.")
!Because might need nco(l) with high l<=max_orbl in create_ri_aux_basis_set ! Generate a default basis
CALL get_qs_kind_set(qs_kind_set, maxlgto=maxlgto)
CALL init_orbital_pointers(2*maxlgto)
CALL create_ri_aux_basis_set(ri_xas_basis, qs_kind, dft_control%auto_basis_ri_xas) CALL create_ri_aux_basis_set(ri_xas_basis, qs_kind, dft_control%auto_basis_ri_xas)
CALL add_basis_set_to_container(qs_kind%basis_sets, ri_xas_basis, "RI_XAS") CALL add_basis_set_to_container(qs_kind%basis_sets, ri_xas_basis, "RI_XAS")
END IF END IF
Expand Down
91 changes: 73 additions & 18 deletions src/qs_o3c_methods.F
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -344,50 +344,63 @@ SUBROUTINE calculate_o3c_libint_integrals(o3c, op, t_c_filename, para_env, r_cut
CHARACTER(len=*), PARAMETER :: routineN = 'calculate_o3c_libint_integrals', & CHARACTER(len=*), PARAMETER :: routineN = 'calculate_o3c_libint_integrals', &
routineP = moduleN//':'//routineN routineP = moduleN//':'//routineN


INTEGER :: egfa, egfb, egfc, handle, ibasis, ikind, imax, iset, jkind, jset, kkind, kset, & INTEGER :: egfa, egfb, egfc, handle, i, ibasis, ikind, ilist, imax, iset, jkind, jset, &
m_max, maxli, maxlj, maxlk, mepos, ncoa, ncob, ncoc, ni, nj, nk, nseta, nsetb, nsetc, & kkind, kset, m_max, max_nset, maxli, maxlj, maxlk, mepos, nbasis, ncoa, ncob, ncoc, ni, &
nspin, nthread, sgfa, sgfb, sgfc, unit_id nj, nk, nseta, nsetb, nsetc, nspin, nthread, sgfa, sgfb, sgfc, unit_id
INTEGER, DIMENSION(:), POINTER :: la_max, la_min, lb_max, lb_min, lc_max, & INTEGER, DIMENSION(:), POINTER :: la_max, la_min, lb_max, lb_min, lc_max, &
lc_min, npgfa, npgfb, npgfc, nsgfa, & lc_min, npgfa, npgfb, npgfc, nsgfa, &
nsgfb, nsgfc nsgfb, nsgfc
INTEGER, DIMENSION(:, :), POINTER :: first_sgfa, first_sgfb, first_sgfc INTEGER, DIMENSION(:, :), POINTER :: first_sgfa, first_sgfb, first_sgfc
LOGICAL :: do_screen LOGICAL :: do_screen
REAL(dp) :: my_eps_screen, my_omega, my_r_cutoff REAL(dp) :: max_val, my_eps_screen, my_omega, &
my_r_cutoff
REAL(dp), ALLOCATABLE, DIMENSION(:, :) :: max_contr, max_contra, max_contrb, &
max_contrc
REAL(dp), ALLOCATABLE, DIMENSION(:, :, :) :: sabc REAL(dp), ALLOCATABLE, DIMENSION(:, :, :) :: sabc
REAL(dp), DIMENSION(3) :: ri, rij, rik, rj, rk REAL(dp), DIMENSION(3) :: ri, rij, rik, rj, rk
REAL(dp), DIMENSION(:, :), POINTER :: sphi_a, sphi_b, sphi_c, tvec, zeta, & REAL(dp), DIMENSION(:, :), POINTER :: sphi_a, sphi_b, sphi_c, tvec, zeta, &
zetb, zetc zetb, zetc
REAL(dp), DIMENSION(:, :, :), POINTER :: iabc REAL(dp), DIMENSION(:, :, :), POINTER :: iabc
TYPE(cp_libint_t) :: lib TYPE(cp_libint_t) :: lib
TYPE(gto_basis_set_p_type), DIMENSION(:), POINTER :: basis_set_list_a, basis_set_list_b, & TYPE(gto_basis_set_p_type), DIMENSION(:), POINTER :: basis_set_list, basis_set_list_a, &
basis_set_list_c basis_set_list_b, basis_set_list_c
TYPE(gto_basis_set_type), POINTER :: basis_set_a, basis_set_b, basis_set_c TYPE(gto_basis_set_type), POINTER :: basis_set, basis_set_a, basis_set_b, &
basis_set_c
TYPE(o3c_iterator_type) :: o3c_iterator TYPE(o3c_iterator_type) :: o3c_iterator


NULLIFY (basis_set_list_a, basis_set_list_b, basis_set_list_c, basis_set_a, basis_set_b) NULLIFY (basis_set_list_a, basis_set_list_b, basis_set_list_c, basis_set_a, basis_set_b)
NULLIFY (basis_set_c, iabc, tvec, first_sgfa, first_sgfb, first_sgfc, la_max, la_min, lb_max) NULLIFY (basis_set_c, iabc, tvec, first_sgfa, first_sgfb, first_sgfc, la_max, la_min, lb_max)
NULLIFY (lb_min, lc_max, lc_min, npgfa, npgfb, npgfc, nsgfa, nsgfb, nsgfc) NULLIFY (lb_min, lc_max, lc_min, npgfa, npgfb, npgfc, nsgfa, nsgfb, nsgfc)
NULLIFY (basis_set, basis_set_list)


CALL timeset(routineN, handle) CALL timeset(routineN, handle)


CALL get_o3c_container(o3c, nspin=nspin, basis_set_list_a=basis_set_list_a, & CALL get_o3c_container(o3c, nspin=nspin, basis_set_list_a=basis_set_list_a, &
basis_set_list_b=basis_set_list_b, basis_set_list_c=basis_set_list_c) basis_set_list_b=basis_set_list_b, basis_set_list_c=basis_set_list_c)


!Need the max l for each basis for libint !Need the max l for each basis for libint (and overall max #of sets for screening)
nbasis = SIZE(basis_set_list_a)
max_nset = 0
maxli = 0 maxli = 0
DO ibasis = 1, SIZE(basis_set_list_a) DO ibasis = 1, nbasis
CALL get_gto_basis_set(gto_basis_set=basis_set_list_a(ibasis)%gto_basis_set, maxl=imax) CALL get_gto_basis_set(gto_basis_set=basis_set_list_a(ibasis)%gto_basis_set, &
maxl=imax, nset=iset)
maxli = MAX(maxli, imax) maxli = MAX(maxli, imax)
max_nset = MAX(max_nset, iset)
END DO END DO
maxlj = 0 maxlj = 0
DO ibasis = 1, SIZE(basis_set_list_b) DO ibasis = 1, nbasis
CALL get_gto_basis_set(gto_basis_set=basis_set_list_b(ibasis)%gto_basis_set, maxl=imax) CALL get_gto_basis_set(gto_basis_set=basis_set_list_b(ibasis)%gto_basis_set, &
maxl=imax, nset=iset)
maxlj = MAX(maxlj, imax) maxlj = MAX(maxlj, imax)
max_nset = MAX(max_nset, iset)
END DO END DO
maxlk = 0 maxlk = 0
DO ibasis = 1, SIZE(basis_set_list_c) DO ibasis = 1, nbasis
CALL get_gto_basis_set(gto_basis_set=basis_set_list_c(ibasis)%gto_basis_set, maxl=imax) CALL get_gto_basis_set(gto_basis_set=basis_set_list_c(ibasis)%gto_basis_set, &
maxl=imax, nset=iset)
maxlk = MAX(maxlk, imax) maxlk = MAX(maxlk, imax)
max_nset = MAX(max_nset, iset)
END DO END DO
m_max = maxli+maxlj+maxlk m_max = maxli+maxlj+maxlk


Expand Down Expand Up @@ -429,13 +442,14 @@ SUBROUTINE calculate_o3c_libint_integrals(o3c, op, t_c_filename, para_env, r_cut
CALL o3c_iterator_create(o3c, o3c_iterator, nthread=nthread) CALL o3c_iterator_create(o3c, o3c_iterator, nthread=nthread)


!$OMP PARALLEL DEFAULT(NONE) & !$OMP PARALLEL DEFAULT(NONE) &
!$OMP SHARED (nthread,o3c_iterator,nspin,basis_set_list_a, basis_set_list_b,basis_set_list_c, & !$OMP SHARED (nthread,o3c_iterator,nspin,basis_set_list_a, basis_set_list_b,basis_set_list_c,nbasis,&
!$OMP maxli,maxlj,maxlk,my_r_cutoff,my_omega,ncoset,op,do_screen,my_eps_screen) & !$OMP maxli,maxlj,maxlk,my_r_cutoff,my_omega,ncoset,op,do_screen,my_eps_screen,max_nset) &
!$OMP PRIVATE (basis_set_a,basis_set_b,basis_set_c,mepos,ikind,jkind,kkind,iabc,tvec,rij,rik, & !$OMP PRIVATE (basis_set_a,basis_set_b,basis_set_c,mepos,ikind,jkind,kkind,iabc,tvec,rij,rik, &
!$OMP first_sgfa,la_max,la_min,npgfa,nseta,nsgfa,zeta,iset,ni,ri,ncoa,sgfa,egfa,sphi_a,& !$OMP first_sgfa,la_max,la_min,npgfa,nseta,nsgfa,zeta,iset,ni,ri,ncoa,sgfa,egfa,sphi_a,&
!$OMP first_sgfb,lb_max,lb_min,npgfb,nsetb,nsgfb,zetb,jset,nj,rj,ncob,sgfb,egfb,sphi_b,& !$OMP first_sgfb,lb_max,lb_min,npgfb,nsetb,nsgfb,zetb,jset,nj,rj,ncob,sgfb,egfb,sphi_b,&
!$OMP first_sgfc,lc_max,lc_min,npgfc,nsetc,nsgfc,zetc,kset,nk,rk,ncoc,sgfc,egfc,sphi_c,& !$OMP first_sgfc,lc_max,lc_min,npgfc,nsetc,nsgfc,zetc,kset,nk,rk,ncoc,sgfc,egfc,sphi_c,&
!$OMP sabc,lib) !$OMP sabc,lib,max_contra,max_contrb,max_contrc,ibasis,i,basis_set,basis_set_list,ilist,&
!$OMP max_contr,max_val)


mepos = 0 mepos = 0
!$ mepos = omp_get_thread_num() !$ mepos = omp_get_thread_num()
Expand All @@ -444,6 +458,45 @@ SUBROUTINE calculate_o3c_libint_integrals(o3c, op, t_c_filename, para_env, r_cut
CALL cp_libint_init_3eri(lib, MAX(maxli, maxlj, maxlk)) CALL cp_libint_init_3eri(lib, MAX(maxli, maxlj, maxlk))
CALL cp_libint_set_contrdepth(lib, 1) CALL cp_libint_set_contrdepth(lib, 1)


!get the max_contraction values before we loop, on each thread => least amount of computation
!and false sharing
IF (do_screen) THEN

!Allocate max_contraction arrays such that we have a specific value for each set/kind
ALLOCATE (max_contr(max_nset, nbasis), max_contra(max_nset, nbasis), &
max_contrb(max_nset, nbasis), max_contrc(max_nset, nbasis))

!Not the most elegent, but better than copying 3 times the same
DO ilist = 1, 3

IF (ilist == 1) basis_set_list => basis_set_list_a
IF (ilist == 2) basis_set_list => basis_set_list_b
IF (ilist == 3) basis_set_list => basis_set_list_c

max_contr = 0.0_dp

DO ibasis = 1, nbasis
basis_set => basis_set_list(ibasis)%gto_basis_set

DO iset = 1, basis_set%nset

ncoa = basis_set%npgf(iset)*ncoset(basis_set%lmax(iset))
sgfa = basis_set%first_sgf(1, iset)
egfa = sgfa+basis_set%nsgf_set(iset)-1

max_contr(iset, ibasis) = &
MAXVAL((/(SUM(ABS(basis_set%sphi(1:ncoa, i))), i=sgfa, egfa)/))

END DO !iset
END DO !ibasis

IF (ilist == 1) max_contra(:, :) = max_contr(:, :)
IF (ilist == 2) max_contrb(:, :) = max_contr(:, :)
IF (ilist == 3) max_contrc(:, :) = max_contr(:, :)
END DO !ilist
DEALLOCATE (max_contr)
END IF !do_screen

DO WHILE (o3c_iterate(o3c_iterator, mepos=mepos) == 0) DO WHILE (o3c_iterate(o3c_iterator, mepos=mepos) == 0)


CALL get_o3c_iterator_info(o3c_iterator, mepos=mepos, ikind=ikind, jkind=jkind, & CALL get_o3c_iterator_info(o3c_iterator, mepos=mepos, ikind=ikind, jkind=jkind, &
Expand Down Expand Up @@ -520,7 +573,9 @@ SUBROUTINE calculate_o3c_libint_integrals(o3c, op, t_c_filename, para_env, r_cut
rk, lib, op, omega=my_omega, r_cutoff=my_r_cutoff) rk, lib, op, omega=my_omega, r_cutoff=my_r_cutoff)


IF (do_screen) THEN IF (do_screen) THEN
IF (MAXVAL(ABS(sabc)) < my_eps_screen) THEN max_val = MAXVAL(ABS(sabc))*max_contra(iset, ikind)*max_contrb(jset, jkind) &
*max_contrc(kset, kkind)
IF (max_val < my_eps_screen) THEN
DEALLOCATE (sabc) DEALLOCATE (sabc)
CYCLE CYCLE
END IF END IF
Expand Down
10 changes: 6 additions & 4 deletions src/xas_tdp_atom.F
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -874,15 +874,15 @@ SUBROUTINE calculate_density_coeffs(xas_atom_env, qs_env)
TYPE(distribution_2d_type), POINTER :: opt_dist2d TYPE(distribution_2d_type), POINTER :: opt_dist2d
TYPE(gto_basis_set_p_type), DIMENSION(:), POINTER :: basis_set_orb, basis_set_ri TYPE(gto_basis_set_p_type), DIMENSION(:), POINTER :: basis_set_orb, basis_set_ri
TYPE(neighbor_list_set_p_type), DIMENSION(:), & TYPE(neighbor_list_set_p_type), DIMENSION(:), &
POINTER :: ab_list, ac_list, sab_orb, sab_ri POINTER :: ab_list, ac_list, sab_ri
TYPE(o3c_container_type), POINTER :: o3c TYPE(o3c_container_type), POINTER :: o3c
TYPE(o3c_iterator_type) :: o3c_iterator TYPE(o3c_iterator_type) :: o3c_iterator
TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set
TYPE(qs_rho_type), POINTER :: rho TYPE(qs_rho_type), POINTER :: rho


NULLIFY (qs_kind_set, basis_set_ri, basis_set_orb, ac_list, rho, rho_ao, sab_ri, ri_mats) NULLIFY (qs_kind_set, basis_set_ri, basis_set_orb, ac_list, rho, rho_ao, sab_ri, ri_mats)
NULLIFY (o3c, tvec, particle_set, para_env, all_ri_atoms, sab_orb, overlap) NULLIFY (o3c, tvec, particle_set, para_env, all_ri_atoms, overlap)
NULLIFY (blacs_env, pblock, pblockt, ab_list, opt_dist2d, rho_redist) NULLIFY (blacs_env, pblock, pblockt, ab_list, opt_dist2d, rho_redist)


!Idea: We don't do a full RI here as it would be too expensive in many ways (inversion of a !Idea: We don't do a full RI here as it would be too expensive in many ways (inversion of a
Expand All @@ -897,7 +897,7 @@ SUBROUTINE calculate_density_coeffs(xas_atom_env, qs_env)
CALL timeset(routineN, handle) CALL timeset(routineN, handle)
CALL get_qs_env(qs_env, nkind=nkind, sab_orb=sab_orb, qs_kind_set=qs_kind_set, rho=rho, & CALL get_qs_env(qs_env, nkind=nkind, qs_kind_set=qs_kind_set, rho=rho, &
natom=natom, particle_set=particle_set, & natom=natom, particle_set=particle_set, &
para_env=para_env, blacs_env=blacs_env) para_env=para_env, blacs_env=blacs_env)
nspins = xas_atom_env%nspins nspins = xas_atom_env%nspins
Expand Down Expand Up @@ -950,10 +950,12 @@ SUBROUTINE calculate_density_coeffs(xas_atom_env, qs_env)
!Get the optimal distribution_2d for the overlap integrals (abc), centers c on excited atoms !Get the optimal distribution_2d for the overlap integrals (abc), centers c on excited atoms
!and their neighbors defined by RI_RADIUS !and their neighbors defined by RI_RADIUS
CALL build_xas_tdp_ovlp_nl(ab_list, basis_set_orb, basis_set_orb, qs_env)
CALL build_xas_tdp_3c_nl(ac_list, basis_set_orb, basis_set_ri, do_potential_id, & CALL build_xas_tdp_3c_nl(ac_list, basis_set_orb, basis_set_ri, do_potential_id, &
qs_env, excited_atoms=all_ri_atoms) qs_env, excited_atoms=all_ri_atoms)
CALL get_opt_3c_dist2d(opt_dist2d, sab_orb, ac_list, basis_set_orb, basis_set_orb, & CALL get_opt_3c_dist2d(opt_dist2d, ab_list, ac_list, basis_set_orb, basis_set_orb, &
basis_set_ri, qs_env) basis_set_ri, qs_env)
CALL release_sab(ab_list)
CALL release_sab(ac_list) CALL release_sab(ac_list)
!get the ab and ac neighbor lists based on the optimized distribution !get the ab and ac neighbor lists based on the optimized distribution
Expand Down
10 changes: 5 additions & 5 deletions src/xas_tdp_kernel.F
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -618,8 +618,8 @@ SUBROUTINE kernel_exchange(ex_ker, donor_state, xas_tdp_env, xas_tdp_control, qs
blk_size => donor_state%blk_size blk_size => donor_state%blk_size
!compute the off-diag spin-conserving only if not TDA and anything that is spin-conserving !compute the off-diag spin-conserving only if not TDA and anything that is spin-conserving
do_off_sc = (.NOT. xas_tdp_control%tamm_dancoff) .AND. (xas_tdp_control%do_spin_cons & do_off_sc = (.NOT. xas_tdp_control%tamm_dancoff) .AND. &
.OR. xas_tdp_control%do_singlet .OR. xas_tdp_control%do_triplet) (xas_tdp_control%do_spin_cons .OR. xas_tdp_control%do_singlet .OR. xas_tdp_control%do_triplet)
! Need the once contracted integrals (aI|P) ! Need the once contracted integrals (aI|P)
CALL contract_o3c_int(contr1_int, "EXCHANGE", donor_state, xas_tdp_env, xas_tdp_control, qs_env) CALL contract_o3c_int(contr1_int, "EXCHANGE", donor_state, xas_tdp_env, xas_tdp_control, qs_env)
Expand Down Expand Up @@ -1072,9 +1072,9 @@ SUBROUTINE change_dist(mat_in, mat_out, para_env)
num_pe = para_env%num_pe num_pe = para_env%num_pe
!Allocate a pointer array which will point on the block => we won't need to send more than !Allocate a pointer array which will point on the block => we won't need to send more than
!nblk**2/(2*num_pe) message per processor (only look at upper diagonal, blocks well distributed) !nblk**2/num_pe message per processor (assumes blocks well distributed)
ALLOCATE (send_buff(nblk**2/(2*num_pe)+1), recv_buff(nblk**2/(2*num_pe)+1)) ALLOCATE (send_buff(nblk**2/num_pe+1), recv_buff(nblk**2/num_pe+1))
ALLOCATE (send_req(nblk**2/(2*num_pe)+1), recv_req(nblk**2/(2*num_pe)+1)) ALLOCATE (send_req(nblk**2/num_pe+1), recv_req(nblk**2/num_pe+1))
is = 0; ir = 0 is = 0; ir = 0


!Iterate over input matrix !Iterate over input matrix
Expand Down
Loading

0 comments on commit a957e65

Please sign in to comment.