-
Notifications
You must be signed in to change notification settings - Fork 475
DFJK Expert I/O Control Bonus: PKJK #2926
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
DFJK Expert I/O Control Bonus: PKJK #2926
Conversation
|
Nice idea to apply SCF_SUBTYPE to PK, too. Only thing that concerns me is that now selecting the algorithm (which most ppl won't) is a three-keyword affair: |
Thank you! I had thought about doing this very thing, and I am fine with it if everyone else is. My initial hesitation in doing so, is that Practically speaking, it's not a huge problem, since MemDFJK and DiskDFJK already throw exceptions for incompatible |
|
The some-subtype-values-not-applicable-to-some-scftype-values doesn't bother me too much -- after all, direct, cd, etc. can't take any subtype value besides auto. So long as the read_options docstring is clear and the code rejects non-meaningful subtype choices, I don't think users are led astray. All the same, I'm not hearty on my suggestion because it seems a little indistinct between algorithm choice (usually scftype) and memory transition choice (usually subtype). Maybe, if designed from scratch, there'd be So minimum change, unless others chime in, is leave as-is and add the |
That's all fair, to be honest, although I agree moreso with your second paragraph below, and what you said about indistinctness between algorithm choice and memory transition choice is applicable for sure.
This is true, and a point I hadn't considered, either. I wouldn't mind taking such a project on, but I would probably save it for after v1.8.
Will do! |
|
Deprecation message added! I'm less familiar with deprecating things in Psi4, so let me know if anything else should be done on that front. |
psi4/src/read_options.cc
Outdated
| /*- Maximum numbers of batches to read PK supermatrix. !expert -*/ | ||
| options.add_int("PK_MAX_BUCKETS", 500); | ||
| /*- Select the PK algorithm to use. For debug purposes, selection will be automated later. !expert -*/ | ||
| options.add_str("PK_ALGO", "REORDER", "REORDER YOSHIMINE"); |
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.
After this PR, does this keyword name make sense?
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.
I think so -- it's still the only way to choose btwn reorder and yoshimine when scf_type=PK. Am I missing your point?
EDIT: docstring might be edited to mention if you want PK+INCORE, use subtype.
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 is pretty similar in topic to what @loriab had asked in her review.
It doesn't make any less sense than before, since PK_ALGO does exactly what it did previously - it controls what out-of-core algorithm is selected by PKJK, if an out-of-core algorithm is to be used. Previously, the way one would force an out-of-core algorithm to be used would be to set PK_NO_INCORE = TRUE. Now, out-of-core can be forced by SCF_SUBTYPE = OUT_OF_CORE.
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.
If PK is the algorithm and the subalgorithm is in core or out-of-core, is this a sub-sub-algorithm?
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.
EDIT: docstring might be edited to mention if you want PK+INCORE, use subtype.
This is a good idea! I'd be happy to put that in.
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.
is this a sub-sub-algorithm?
Yeah, that's what I didn't like about it. But the most logical fix I could devise (see above) is expanding scf_type, so this is the least intrusive for now.
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.
What about collapsing PK_ALGO into SCF_SUBTYPE? So for PK, allowed options are INCORE, OOC_REORDER, and OOC_YOSHIMINE?
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.
What about collapsing
PK_ALGOintoSCF_SUBTYPE? So for PK, allowed options areINCORE,OOC_REORDER, andOOC_YOSHIMINE?
This is a possibility I had thought of. I was originally concerned about it because keywords like OOC_REORDER and OOC_YOSHIMINE wouldn't apply to MemDFJK and DiskDFJK, which SCF_SUBTYPE also controls (although I've been convinced otherwise about this being a significant issue). There is also the issue that SCF_SUBTYPE has a specific intent currently of controlling in-core vs. out-of-core; and adding Yoshimine and Reorder keywords to SCF_SUBTYPE muddies the waters in that regard, since it would become unclear whether SCF_SUBTYPE deals with more specific sub-algorithm choice, or simply choice of in-core vs. out-of-core.
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.
If there's enough support for folding PK_ALGO into SCF_SUBTYPE, however, I wouldn't mind doing that for this PR. I would also be happy to tackle Lori's proposal, but I'd rather that be for another PR.
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.
I'm still for folding PK_ALGO into SCF_SUBTYPE, thanks for considering.
Agreed that Lori's proposal is beyond-scope.
|
Hi all! I was working on folding the By default, using There are probably a few ways to resolve this, if we choose to explicitly continue on this path:
What does everyone think? |
|
If it's not awful to implement, I'd make the SAD guess impervious to SCF_SUBTYPE. The user setting SCF_SUBTYPE is thinking about the main iterations, not the guess, and if this is some highly technical timing, the guess type might be reset anyways. Also, I think it should be |
Yeah, I'd agree with this. I can look into it and see if it's a quick fix or not.
Yeah, I'll do that, as well! |
|
All right, I disabled |
Ah, turning it off py-side is simple and great, but there's a better way. The minor trouble with your approach is that it's restoring the value but not the status of whether the user has set it. That latter piece of info is often used to decide whether an option is default or not or whether, once control has returned to the user, to write the option explicitly in subsequent calcs. The usual remedy that you'll see scattered in proc.py are optstash=OptionsState([list o options]) ... do work ... optstash.restore(). So I'd suggest using that or the content manager like https://github.com/psi4/psi4/pull/2926/files#diff-2aec42d854b50db94cde6a3f9d3c665eed11e8f1f083040807d9e4dd4696895aL67-L68 |
Done and done! This is all great knowledge; thank you! |
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.
thanks! much easier to read.
|
So now that this PR and #2924 have both been approved for adding to the merge queue, my guess is that there will be a merge conflict between the two, at the |
Sounds worth adding these two to the queue and seeing how it handles the second. Agree that probably you'll have to rebase or reconcile somehow. |
Yeah, I don't think we've had an actual merge conflict from the merge queue yet (at least not that I have seen), so it can be an experiment to see what happens in that case. |
Co-authored-by: Lori A. Burns <[email protected]>
Co-authored-by: Lori A. Burns <[email protected]>
bcc517c to
88f9a22
Compare
|
I suppose if anyone wants to check the merged |
Description
This PR is a companion PR to #2848 and #2924. Those two PRs introduced the
SCF_SUBTYPEkeyword to Psi4, allowing for specifications of subalgorithms in SCF methods where appropriate, and applied theSCF_SUBTYPEkeyword to MemDFJK and DiskDFJK, respectively.As it turns out, the DFJK algorithms aren't the only JK algorithms where this new keyword may be useful.
The PKJK algorithm contains a number of subalgorithms, as well - an in-core algorithm (labeled InCore in the code) and two out-of-core algorithms (labeled Reorder and Yoshimine in the code). PKJK has some amount of control over which subalgorithm is utilized already - the
PK_ALGOkeyword specifies whether the Reorder or Yoshimine out-of-core algorithm is to be used, if an out-of-core algorithm is used; while thePK_NO_INCOREkeyword disables the InCore PK algorithm and forces one of the out-of-core algorithms to be used. If the functionality ofPK_NO_INCOREseems familiar, that's because it is - it is effectively the exact same thing asSCF_SUBTYPE=OUT_OF_COREfor MemDFJK (in #2848) and DiskDFJK (in #2924).The goal of this PR is to clean that up;
PK_NO_INCOREis replaced bySCF_SUBTYPEfor PKJK.SCF_SUBTYPE=OUT_OF_COREhas the exact same effect thatPK_NO_INCORE=TRUEhad previously.SCF_SUBTYPE=AUTOhas PKJK select in-core or out-of-core by default, as per usual. Finally,SCF_SUBTYPE=INCOREallows PKJK to force-execute its in-core algorithm, a new functionality for PKJK as far as I am aware. As usual withSCF_SUBTYPE, setting it toINCOREwithout allocating sufficient memory to Psi4 will throw an exception.User API & Changelog headlines
PK_NO_INCOREkeyword has been removed.SCF_SUBTYPEkeyword has been added for PKJK.SCF_SUBTYPE=AUTOhas PKJK select the subalgorithm by default.SCF_SUBTYPE=OUT_OF_COREforces PKJK to use one of the two out-of-core algorithms (equivalent toPK_NO_INCORE=TRUEpreviously).SCF_SUBTYPE=INCOREforces PKJK to use its in-core algorithm, and throws an exception if insufficient memory is allocated.Dev notes & details
PK_NO_INCOREkeyword for PKJK has been replaced with the newSCF_SUBTYPEkeyword.Questions
-N/A
Checklist
new features
Status