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

Require named SPOSet #4160

Merged
merged 5 commits into from
Aug 10, 2022
Merged

Require named SPOSet #4160

merged 5 commits into from
Aug 10, 2022

Conversation

ye-luo
Copy link
Contributor

@ye-luo ye-luo commented Aug 8, 2022

Review can be done independent from #4158 but need its fix of tests before merging.

Proposed changes

The major change is in SPOSet.h

  1. require it named
  2. isOptimizable isOptimizable hasIonDerivs getClassName are virtual functions instead of relying on member variables.
  3. make it inherited from OptimizableObject. This change will be soon reverted as OptimizableObject will be used in actual optimizable derived classes. The change will come with a later PR.
  4. in SPOSet builders, implicit sharing SPOSet for spin-up/down has been removed. Users may hit memory overhead if they are still using legacy input style instead of sposet_collection. I think it is time to phase out the legacy input style with SPOSet constructed inside determinants.

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

  • New feature
  • Refactoring (no functional changes, no api changes)

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

epyc-server

Checklist

  • Yes. This PR is up to date with current the current state of 'develop'

@ye-luo ye-luo requested a review from PDoakORNL August 8, 2022 14:06
Copy link
Contributor

@prckent prckent left a comment

Choose a reason for hiding this comment

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

What are the relevant considerations regarding backwards compatibility (or not) here?

@ye-luo
Copy link
Contributor Author

ye-luo commented Aug 9, 2022

What are the relevant considerations regarding backwards compatibility (or not) here?

The deprecation warning has been printed for quite a few releases. With the change from this PR, those input files will continue to run but with memory penalty. We continue issue warnings to users reminding them to change input style. I have not decided to turn the warning to error.

@prckent prckent self-requested a review August 9, 2022 21:11
Copy link
Contributor

@prckent prckent left a comment

Choose a reason for hiding this comment

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

LGTM but please wait for @PDoakORNL

Happy to see the appearance of accessor functions

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.

Just couple of proofreading changes and a question about name and id tags otherwise this looks like a good step.

PosType twist(0.0);
OhmmsAttributeSet attrib;
attrib.add(norb, "size");
attrib.add(twist, "twist");
attrib.add(spo_object_name, "name");
Copy link
Contributor

Choose a reason for hiding this comment

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

If id is intended to be an alternate input tag for the spo_object_name it is missing here.

Copy link
Contributor Author

@ye-luo ye-luo Aug 9, 2022

Choose a reason for hiding this comment

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

In a couple of places, name and id are interchangeable. In this PR, I added both because there are existing input files. It is unclear how we would like to move forward. My current thought is to disable "id" support and allow "name" only. Supporting both requires do a lot of extra things, for example trapping errors when "name" and "id" differ.

For now, we need both both. Here is what I will do.

attrib.add(spo_object_name, "name");
attrib.add(spo_object_name, "id", {}, TagStatus::DEPRECATED)

and later change to TagStatus::DELETED.

I will do a separate to address this change. There are a few places beyond this PR.

~FreeOrbital();

std::string getClassName() const override { return "FreeOrbital"; }
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is just used for error reporting/debugging, which is what I see, its fine if we need runtime reflection I don't think we should do it via string matching.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. If we need to make selection based on derived class types, we should do enum not strings. It is only intended for printing.

sposet = std::move(rot_spo);
#endif
}

if (!spo_object_name.empty() && sposet->getName().empty())
sposet->setName(spo_object_name);
//if (!spo_object_name.empty() && sposet->getName().empty())
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please allow me to do it in my next PR.

@williamfgc
Copy link
Contributor

Test this please

@ye-luo
Copy link
Contributor Author

ye-luo commented Aug 10, 2022

Test this please

@ye-luo ye-luo merged commit 53a686d into QMCPACK:develop Aug 10, 2022
@ye-luo ye-luo deleted the sposet-name branch August 10, 2022 17:08
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