-
Notifications
You must be signed in to change notification settings - Fork 475
Clean up #includes, macros, unnecessary array init, error exits, and other miscellaneous things in libmoinfo #3112
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
Conversation
7c18fe0 to
af87cd8
Compare
af87cd8 to
ec9d06b
Compare
ec9d06b to
64efa52
Compare
loriab
left a comment
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.
Besides the forward decl issue, this looks reasonable to me. These are FAE modules, though, so will seek input. Thanks for the modernization!
|
Thank you for making these improvements! This code was written before C++11 so it's really old style. I've left some comments here and there for things that need to be taken care. |
|
|
||
| public: | ||
| typedef std::bitset<size_det> bitdet; | ||
| typedef std::bitset<2048> bitdet; // adjust based on "size det"? |
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.
Just to double check: was size_det used only here? It might be a good idea to make this a static constant expression in the class SlaterDeterminant.
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.
Yes, this was the only hit for size_det in the entire repo. I have also searched for 2048 to check for things assuming this size, and found nothing. So having it "inline" like this seems like the most straightforward solution.
b0f64ac to
6bd09e7
Compare
(cherry picked from commit c11e558)
(cherry picked from commit 18c3471)
(cherry picked from commit 37245f3)
…e defined in the base class (cherry picked from commit c860f06)
(cherry picked from commit 081737c)
(cherry picked from commit 4762398)
(cherry picked from commit a56b0aa)
… its keywords do not clutter the entire psi namespace
… so that its keywords do not clutter the entire psi namespace" This reverts commit 27b9178.
Lori's suggestion Co-authored-by: Lori A. Burns <[email protected]> (cherry picked from commit 180b8c4)
…ses instead of including liboptions.h and wavefunction.h
…l_space_build.cc have to include moinfo.h again
bff3d39 to
d55aae5
Compare
Description
This PR aims to make a lot of tiny improvements to libmoinfo.
While trying to modernize a bit of libmoinfo code to eliminate some (ab)use of the Dimension functions deprecated by PR #2953 I had to try to get at least some grip on what-does-what, but libmoinfo has accumulated some clutter which made that harder than necessary.
One thing led to another, and now this PR is here to hopefully make it easier for the next person.
Docstring addition and more are the subject of a future PR.
User API & Changelog headlines
Dev notes & details
#define size_detstd::vector<size_t> ioff, its getter function, and initialization fromMOInfoBase. It looks like this 5 M element array was getting non-trivially initialized every time anMOInfoBaseobject (or one derived from it) was constructed. RAM usage of these objects should now be 40 MB lower, and their construction should be faster by an unknown amount..hinstead where required instead of them (Note: some of this was reverted after reviews, see discussion on this PR.)tuning()andread_mo_spaces2(), as they are never definedMOInfo, either unused or already defined in the base class.MOInfoBase::get_irr_labs()MOInfoBase::get_irr_labs(int i)toget_irr_lab, as it only gets one label. Rename propagated to all of its call sites.MOInfoBase::get_scf_mos(int i)intvecandboolvectypedefs from global namespace, tonamespace psi. Also modernized them to theusingsyntax.extern ModelSpace* model_spacedeclaration which was clutteringnamespace psiReplacedObviated by PR Do not call exit #3118exit(PSI_RETURN_FAILURE)andexit(1)withthrow PSIEXCEPTIONChecklist
Status