-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: new gint module #5869
base: develop
Are you sure you want to change the base?
Conversation
This reverts commit 414446a.
void Veff<OperatorLCAO<TK, TR>>::contributeHR() | ||
if(this->nspin == 2) | ||
{ | ||
this->current_spin = 1 - this->current_spin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code is a bit strange, may need to rewrite
std::vector<double> ddphi_zz; | ||
ModuleBase::matrix* fvl_thread = nullptr; | ||
ModuleBase::matrix* svl_thread = nullptr; | ||
if(isforce_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel it is a better design to let 'isforce_' and 'isstress_' parameters to be input parameters of this function 'cal_fvl_svl_()', and enforce them to be 'const'
dphi_x.resize(phi_len); | ||
dphi_y.resize(phi_len); | ||
dphi_z.resize(phi_len); | ||
dphi_x_DM.resize(phi_len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to use 'dm' instead of 'DM' in the new grid integral code.
phi_op.set_phi_dphi(nullptr, dphi_x.data(), dphi_y.data(), dphi_z.data()); | ||
for (int is = 0; is < nspin_; is++) | ||
{ | ||
phi_op.phi_mul_dm(dphi_x.data(), *DMRGint_vec_[is], true, dphi_x_DM.data()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to use 'dmr_gint' instead of 'DMRGint'
//======================== | ||
double dr3_; | ||
|
||
std::shared_ptr<HContainer<double>> hRGint_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use 'hr_gint_'instead of 'hRGint_'?
public: | ||
// constructor | ||
UnitCellInfo( | ||
Vec3d unitcell_vec1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to 'const Vec3d &unitcell_vec1'?
Background
The original
module_gint
was disorganized, with input and output for different grid integration tasks mixed together. Additionally, the overall framework for grid integration was poorly structured. This PR rewrites the grid integration framework. The new code is located undersource/module_hamilt_lcao/module_gint/new_gint
.Since the new code is not yet complete—GPU version grid integration, for example, has not been implemented in this PR—it is considered an experimental PR. Only a portion of the old grid integration interfaces have been replaced with the new grid integration interfaces and the old grid integration code will be retained until the new grid integration code is fully completed, at which point it will be removed. Moreover, the new grid integration code will only be compiled when
-DNEW_GINT
is set during CMake configuration.Unit Tests and/or Case Tests for my changes
What's changed?
module_gint
code, if-DNEW_GINT
is set during CMake configuration, some interfaces of old version ofmodule_gint
will be replaced with new version.Performance Comparison
Based on current testing, the new grid integration code shows slightly higher efficiency due to more detailed optimizations。 Below are the results from running the si64 in tests/performance on my computer using
OMP_NUM_THREADS=4 mpirun -n 4 abacus
: