-
Notifications
You must be signed in to change notification settings - Fork 467
Saptdft reuse jk for scf #3256
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
Saptdft reuse jk for scf #3256
Conversation
Is this ready for review? If so, please check "Ready for review" in the front page. If not, please mark this PR as a draft. |
Yes, it is ready for review. Thank you for letting me know that I needed to check that box. |
Co-authored-by: Jonathon Misiewicz <jpmisiewicz@vt.edu>
…into saptdft_reuse_jk_for_scf
@@ -541,7 +549,7 @@ def run_sf_sapt(name, **kwargs): | |||
core.IO.set_default_namespace('dimer') | |||
data = {} | |||
|
|||
if (core.get_global_option('SCF_TYPE') == 'DF'): | |||
if (core.get_global_option('SCF_TYPE') == 'DISK_DF'): |
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.
Why is this and only this specific to DISK_DF?
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.
Good catch seeing this in another function. I have corrected this to match the other sections of the code.
Co-authored-by: Jonathon Misiewicz <jpmisiewicz@vt.edu>
…into saptdft_reuse_jk_for_scf
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.
Looks good! @Awallace3 can you look at my comment regarding the DF_INTS_IO
option? (See https://github.com/psi4/psi4/blob/master/psi4/src/psi4/libfock/jk.cc#L239)
The best way to test this is to make sure that MemDF will still run when JK is reused.
# We want to try to re-use itegrals for the dimer and monomer SCF's. | ||
# If we are using Disk based DF (DISK_DF) then we can use the | ||
# DF_INTS_IO option. MemDF does not know about this option but setting | ||
# it will be harmless there. | ||
core.set_global_option('DF_INTS_IO', 'SAVE') |
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.
Can you double check that setting this does not change the DF algorithm to DiskDF? In the options docs for DF_INTS_IO
it says IO caching for CP corrections, etc. Changing this selects Disk_DF over Mem_DF. Note that setting this forces DiskDFJK when SCF_TYPE=DF.
(see https://github.com/psi4/psi4/blob/master/psi4/src/read_options.cc#L1674)
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 for addressing my concerns! LGTM!
Thanks Andy! Your careful consideration helped remove some undesirable functionality of DF_INTS_IO when trying to prefer MemDF over DiskDF in the SAPT(DFT) code (when applicable). |
…into saptdft_reuse_jk_for_scf
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 for getting this sorted out! A local full tests is clean (Austin, the failure I mentioned seeing was due to unrelated local edits).
@@ -237,22 +237,16 @@ std::shared_ptr<JK> JK::build_JK(std::shared_ptr<BasisSet> primary, std::shared_ | |||
Options& options, bool do_wK, size_t doubles) { | |||
std::string jk_type = options.get_str("SCF_TYPE"); | |||
if (jk_type == "DF") { | |||
// logic for MemDFJK vs DiskDFJK | |||
if (options["DF_INTS_IO"].has_changed()) { |
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.
For reference, the old behavior of touching DF_INTS_IO
forces DISK_DF was a deliberate change made here
2b53daa that seems non-intuitive in retrospect.
Description
Previously, SAPT(DFT)
scf_helper()
calls would re-compute integrals for SAPT0 dimer and monomer computations. Furthermore, the DFTscf_helper()
calls would also recompute 3-index integrals by regenerating the JK-object. This PR enables developers to pass in a jk object to scf_helper to not re-compute 3-index DF integrals if desired. This change was largely drafted during a meeting between @cdsgroup with @konpat on Dec. 13th, 2024. Further tested in a 7 Feb 2025 meetup.closes #3173
User API & Changelog headlines
Dev notes & details
scf_helper()
to prevent re-computing integrals for SCF.Questions
Checklist
Status