Skip to content

Conversation

@sunliang98
Copy link
Collaborator

@sunliang98 sunliang98 commented Oct 14, 2025

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #6601

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

This PR fixes inconsistencies in parallel computation results. Below are two examples demonstrating the improvements:

  1. K-points Parallelism (01_PW/004_PW_UPF201_Si, Si)

Before fix:

kpar E_bandgap (Ry)
1 0.0298852541
2 0.1033124558
3 0.1762318244

After fix:

kpar E_bandgap (Ry)
1 0.0298852541
2 0.0298852541
3 0.0298852541
  1. Band Parallelism (11_PW_GPU/001_PW_BPCG_GPU, GaAs, run with CPU)

Before fix:

nCPU E_bandgap (Ry)
1 0.0416524880
4 inf

After fix:

nCPU E_bandgap (Ry)
1 0.0416524880
4 0.0416513276

Results are now consistent across different parallel configurations

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

@sunliang98 sunliang98 requested a review from mohanchen October 14, 2025 08:59
@mohanchen mohanchen added Bugs Bugs that only solvable with sufficient knowledge of DFT Features Needed The features are indeed needed, and developers should have sophisticated knowledge labels Oct 15, 2025
@mohanchen mohanchen added the Refactor Refactor ABACUS codes label Oct 15, 2025
@mohanchen mohanchen merged commit 1f86285 into deepmodeling:develop Oct 15, 2025
14 checks passed
@sunliang98 sunliang98 deleted the fix_bandgap branch October 24, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT 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.

The function cal_bandgap does not account for parallelism of k-points and bands

2 participants