abacus-develop icon indicating copy to clipboard operation
abacus-develop copied to clipboard

Problems about `out_mat_dh` and `Gint::cpu_dvlocal_interface`

Open maki49 opened this issue 1 year ago • 1 comments

Details

  1. It seems that out_mat_dh calculates only the Pulay term $\braket{\phi|H|d\phi}$ while the Hellmann-Feynman term $\braket{\phi|dH|\phi}$ is missing? (see the implementation in sparse_format::cal_dH)
  2. In Gint::cpu_dvlocal_interface (only used when out_mat_dh=1 and nspin=2), @A-006 finds that pvdpRx_thread is calculated but not copied into pvdpRx_reduced, which makes the results different with or without OpenMP.

maki49 avatar Jul 29 '24 05:07 maki49

Here is the part that calculates Cu

examples/scf/lcao_Cu/INPUT INPUT_PARAMETERS pseudo_dir ../../../tests/PP_ORB orbital_dir ../../../tests/PP_ORB nbands 10 calculation scf ecutwfc 100 scf_thr 1.0e-8 scf_nmax 100 smearing_method gaussian smearing_sigma 0.02 mixing_type broyden mixing_beta 0.4 basis_type lcao gamma_only 0 cal_force 1 cal_stress 1 nspin 2 out_mat_dh 1

1.The calculation results are consistent whether OpenMP is used or not. 2.Whether or not it is accumulated to pvdpRy_reduced, the result is consistent.

What part is this function used to calculate?

A-006 avatar Aug 15 '24 11:08 A-006

in the PR #4827 ,i add the openmp gather in the source/module_hamilt_lcao/module_gint/gint_vl_cpu_interface.cpp:204-223。now the dvlocal has been add to the openmp.Can pvdpRx_reduced be correctly calculated now?

A-006 avatar Oct 29 '24 08:10 A-006

Now the calculation result of gint_kernel_dvlocal will be copied to pvdpRx_reduced. It is not clear whether the calculation result is correct, and it is necessary to understand how to handle the calculation result of dv. Is there a way to add unit tests here?

A-006 avatar Oct 30 '24 11:10 A-006

Now,Refactor the code section to make the OpenMP results consistent, and integration tests will be added later.

A-006 avatar Dec 24 '24 08:12 A-006