-
Notifications
You must be signed in to change notification settings - Fork 142
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
add mw_ APIs to RotatedSPO #4701
Conversation
Test this please |
src/QMCWaveFunctions/RotatedSPOs.h
Outdated
/// Use global rotation or history list | ||
bool use_global_rot_ = true; | ||
|
||
friend opt_variables_type& testing::getMyVarsFull(RotatedSPOs& rot); | ||
friend std::vector<std::vector<RealType>>& testing::getHistoryParams(RotatedSPOs& rot); | ||
}; | ||
|
||
static RefVectorWithLeader<SPOSet> extractPhiRefList(const RefVectorWithLeader<SPOSet>& spo_list); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs to be a member, static member.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And still under private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
Proposed changes
In the case where we go straight from an optimization into a VMC/DMC in the same run, or with WF evaluation during optimization we want to be able to utilize mw_ APIs and offload when using RotatedSPOs. Currently, since RotatedSPOs inherits from SPOSet and doesn't have any mw_ APIs defined, it will just fall back to the single walker APIs. This PR adds the resource management and mw_ APIs to RotatedSPOs, which simply call its underlying SPOSet's resource and mw_ APIs.
I made a unit test to check that these mw_ APIs have the correct behavior by introducing two "dummy" SPOSets, one that has mw_ APIs defined and one that doesn't. A RotatedSPO for the dummy SPO which doesn't have any mw_ specialization does RotatedSPOs::mw_XXX which calls underlying SPO::mw_XXX. Since it isn't defined, it defaults to loop over single walker APIs. But in the case where the underlying SPOSet does have mw_ defined, we want it to have the appropriate behavior. The dummy test SPOSets I created set different values in different APIs to ensure that the appropriate code paths are being followed for mw_evaluateValue. I assumed it would be sufficient to test only that one, but can add more if needed.
Also, if there is a better way to test this, let me know and I can make some changes.
What type(s) of changes does this code introduce?
Delete the items that do not apply
Does this introduce a breaking change?
What systems has this change been tested on?
macOS
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.