Skip to content
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

[WIP] fix kpoint sorting #5327

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

PDoakORNL
Copy link
Contributor

@PDoakORNL PDoakORNL commented Feb 19, 2025

Proposed changes

To get consistent kpoint sorting across compilers and mixed and full precision simulations should rely on full precision for the CrystalLattice and KContainer should do the kpoint sorting in full precision. Then to preserve mixing precision performance where applicable reduced precision ksq and kpts_cart access via the get*Working calls added to KContainer are available.

This unfortunately touches a huge number of files since There are many tests that directly define CrystalLattice's and they do this either explicitly in mixed precision or by using the PtclOnLatticeTraits::ParticleLayout type alias.

Some deterministic test values for mixed precision are now enough closer to full precision that they fall outside of the tolerance of the tests. Rather than drop the tolerance I have updated the values when they are closer to full precision that the previous test targets. This requires many one line updates through CMakeLists.txt in the deterministics tests and it will take some time to complete.

What type(s) of changes does this code introduce?

Delete the items that do not apply

  • Bugfix
  • New feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Testing changes (e.g. new unit/integration/performance tests)
  • Documentation or build script changes
  • Other (please describe):

Does this introduce a breaking change?

  • Yes
  • No

What systems has this change been tested on?

Checklist

Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.

  • Yes/No. This PR is up to date with current the current state of 'develop'
  • Yes/No. Code added or changed in the PR has been clang-formatted
  • Yes/No. This PR adds tests to cover any new code, or to catch a bug that is being fixed
  • Yes/No. Documentation has been added (if appropriate)

@ye-luo
Copy link
Contributor

ye-luo commented Feb 21, 2025

I guess all the changes under src/Particle/Lattice can be PRed separately.

@prckent
Copy link
Contributor

prckent commented Feb 21, 2025

I took a quick look at the failures. Offload compilations obviously need fixing. The remaining ionion test failures look very reasonable and come from only a couple of systems. Importantly these are truly deterministic "simple" function evaluations of the fixed input atomic positions => if you wished you could set the mixed and full precision values identical in these cases (if they are not already) and bump the tolerances to suit.

@prckent
Copy link
Contributor

prckent commented Feb 21, 2025

Test this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants