Skip to content

Conversation

@dzzz2001
Copy link
Collaborator

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 under source/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

  • unit test is in progress.

What's changed?

  • add new module_gint code, if -DNEW_GINT is set during CMake configuration, some interfaces of old version of module_gint will be replaced with new version.
  • the commit 414446a is not appropriate. After discussing with the commit author @A-006, I revert this commit in this PR.

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:

cal_gint_vl cal_gint_rho cal_gint_force
old module_gint 10.44 9.62 2.91
new module_gint 8.83 8.85 2.36

@dzzz2001 dzzz2001 requested a review from mohanchen January 18, 2025 14:07
@mohanchen mohanchen added Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes labels Jan 19, 2025
@mohanchen mohanchen merged commit 105fd19 into deepmodeling:develop Feb 10, 2025
14 checks passed
@mohanchen mohanchen added the The Absolute Zero Reduce the "entropy" of the code to 0 label Feb 10, 2025
Fisherd99 pushed a commit to Fisherd99/abacus-BSE that referenced this pull request Mar 31, 2025
* remove redundant parameters

* version 0.0

* inline some simple functions

* change type alias

* version 0.1

* version 0.2

* for test

* fix some bugs, the first correct version

* improve efficiency ang rename some variables

* small change

* add openmp support to gint_vl

* remove some comments

* remove some comments

* remove some unused code related to spin in gint_k

* enable rho calculation

* support fvl calculation

* add nspin=4 support and  change interface

* change some raw pointer to shared_ptr

* rename hamilt::HContainer

* support tau calculation

* fix a bug

* add vlocal metagga support

* support force metagga calculation

* change shared_ptr to raw pointer of GintAtom

* improve performance

* remove destructor

* add timer

* add timer

* improve performance

* change 2D ptr to 1D ptr

* modify zeros function

* replace array pool with vector

* Revert "Refactor:remove cal_tau from ElecStateLCAO (deepmodeling#5802)"

This reverts commit 414446a.

* fix a bug

* remove some rudundant functions

* simplify member function of biggrid_info

* rename some variables

* unify some variables name

* change some variable to static

* fix a bug and delete a redundant operation

* add new gint interface

* change new_grid_tech to new_gint

* revert some incorrect changes

* add a unit test

* change some names

* check nullptr

* [pre-commit.ci lite] apply automatic fixes

* change DM to dm

* change HRGint to hr_gint

* modify variable name

* fix a bug

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes The Absolute Zero Reduce the "entropy" of the code to 0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants