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

Update handling of array sizes in SplineR2R and SplineC2C for rotation cases #4288

Merged
merged 9 commits into from
Oct 26, 2022

Conversation

markdewing
Copy link
Contributor

In the case of orbital rotation, the orbital set size from the H5 file may not match the number of SPOs used, which may not match the number of occupied orbitals.

In BsplineSet.h, the slices of the matrices need to have a size consistent with the size of the matrix.

In SplineR2R.cpp, use the size of psi rather than myV. In the call to evaluate3d it doesn't matter because all the inputs are sized the same as myV, but in the following call to assign_*, the size discrepancy can cause invalid accesses.

Add a Python script for evaluating SPOs given the HDF file of coefficients. It uses autograd to evaluate the spatial derivatives.

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

Delete the items that do not apply

  • Bugfix

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

desktop

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

myV is sized to an aligned value, and so its size may be greater than
the size of psi.  Which doesn't cause a problem in the evaluate3d call, but can
cause invalid accesses in the assign_* call.
Make the size of vector that is a slice of the matrix consistent with the
size of the matrix.
Test the case where the size of psi is not the same as the orbital set
size.
Add a script to validate the spline evaluation.
Use 2*psi instead of myV
@markdewing markdewing changed the title Update handling of array sizes in SplineR2R for rotation cases Update handling of array sizes in SplineR2R and SplineC2C for rotation cases Oct 21, 2022
Copy link
Contributor

@PDoakORNL PDoakORNL left a comment

Choose a reason for hiding this comment

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

Haven't look at this file in a while. I feel kinda nauseous. Considering the centrality of spline evaluation in the code its sad that SIMD optimization requirements seem to result in C from the nineties.

The factor of 2 in the size comes from using real types for storing
complex numbers.
PDoakORNL
PDoakORNL previously approved these changes Oct 24, 2022
@PDoakORNL
Copy link
Contributor

test this please

prckent
prckent previously approved these changes Oct 24, 2022
@markdewing
Copy link
Contributor Author

Test this please

Fix errors in the CUDA build with the test in test_einset.cpp where
the input psi is a different size than the orbital set size.
@markdewing markdewing dismissed stale reviews from prckent and PDoakORNL via bdded4e October 25, 2022 20:46
@markdewing
Copy link
Contributor Author

Test this please

@ye-luo
Copy link
Contributor

ye-luo commented Oct 25, 2022

Test this please

@ye-luo ye-luo enabled auto-merge October 25, 2022 23:02
@ye-luo ye-luo merged commit ad2f827 into QMCPACK:develop Oct 26, 2022
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.

4 participants