Skip to content

Fix: Change int to long long in save_sparse to avoid overflow.#6743

Merged
mohanchen merged 3 commits intodeepmodeling:developfrom
ErjieWu:fix
Dec 1, 2025
Merged

Fix: Change int to long long in save_sparse to avoid overflow.#6743
mohanchen merged 3 commits intodeepmodeling:developfrom
ErjieWu:fix

Conversation

@ErjieWu
Copy link
Collaborator

@ErjieWu ErjieWu commented Nov 28, 2025

Linked Issue

Fix #6730

What's changed?

  • Change int to long long in save_sparse to avoid overflow.

@ErjieWu ErjieWu marked this pull request as draft November 28, 2025 07:47
@ErjieWu ErjieWu marked this pull request as ready for review December 1, 2025 04:12
@ErjieWu
Copy link
Collaborator Author

ErjieWu commented Dec 1, 2025

Ready for merge. Another question is the speed for get_S calculation.
In #6460 , we've tested the bottleneck for get_S calculation for systems with not so large atom numbers and found std::map restrict the performance. However, for large systems, I/O is also bottleneck. For R=[0 0 0], the number of non-zero element can be larger than 2^31 and the io for this R is extremely slow (Data write in order in 3 lines). Maybe there are some solutions to this.

Copy link
Collaborator

@mohanchen mohanchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mohanchen mohanchen added Refactor Refactor ABACUS codes Features Needed The features are indeed needed, and developers should have sophisticated knowledge labels Dec 1, 2025
@mohanchen mohanchen merged commit 414f59a into deepmodeling:develop Dec 1, 2025
14 checks passed
@JTaozhang
Copy link

thanks a lot for help. So the problem will be disappeared in the new version?

Best,
Tao

@ErjieWu ErjieWu deleted the fix branch December 23, 2025 05:19
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_s producing super large overlap matrix failed

3 participants