Skip to content

Conversation

loriab
Copy link
Member

@loriab loriab commented Aug 9, 2022

Description

This is the make-dfocc-work-reliably and bring-dfocc-testing-to-normal-level step of mega-dfocc-remp. All the former by @behnle.

REVIEW COMMIT 3 ONLY I'll get the first two merged and out of the way shortly.

This is PR No. 3 in the mega-dfocc-remp series.

Todos

  • no new methods
  • coupled DIIS ported from OCC! fixes Coupled DIIS for dfocc #2215. now dfocc can be converged tightly enough that 5-pt findif gradient matches analytic gradient
  • potential integer overflows fixed which may lead to wrong memory demand estimates for large molecules
  • stdsuite testing added for plain RHF DF/CD a-ccsd(t) energies and DF/CD energies and DF gradients for OO methods omp2, omp2.5, omp3, & olccd. attendantly, qcvar handling in the managers brought up to modern standards, with most saving on wfn, and freebie methods saved and checked
  • update run_dfocc in driver to dict/director syntax (works b/c cc_lambda_ now set in dfocc.cc) and uniform P::e/wfn handling of qcvars
  • tightened convergence so that default conditions match values to 1e-6
    • tightened base rms_mograd_convergence from 4 to 6.5 for oo methods (matches occ, which had to be tightened from 6 to 6.5)
    • tightened r_convergence to same on the basis of e_conv for non-oo methods
    • added an extra check that difference in orbitals at convergence not too big a step

Checklist

Status

  • Ready for review
  • Ready for merge

@JonathonMisiewicz
Copy link
Contributor

Please request review from me once both #2663 is in and all merge conflicts are resolved.

@loriab loriab force-pushed the combo_diis_only_really branch from 0862382 to 5f93077 Compare August 9, 2022 18:25
@loriab loriab added enhancement testing dfocc For issues in the DFOCC module. labels Aug 9, 2022
Copy link
Contributor

@JonathonMisiewicz JonathonMisiewicz left a comment

Choose a reason for hiding this comment

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

Mostly, this is great. But using new is so old...

@loriab loriab force-pushed the combo_diis_only_really branch from 5f93077 to 925a84a Compare August 10, 2022 01:12
@loriab
Copy link
Member Author

loriab commented Aug 10, 2022

All fixed up after Jonathon round 1 review.

@susilehtola
Copy link
Member

long int? Why not just size_t which is quite literally the size type.

@loriab
Copy link
Member Author

loriab commented Aug 11, 2022

long int? Why not just size_t which is quite literally the size type.

No reason, I guess. Some modules used long int before we went on a size_t fest a few years ago. I can switch them (and update the printouts from MB to GB) if folks concur. It would be shorter.

@behnle
Copy link
Contributor

behnle commented Aug 11, 2022

long int? Why not just size_t which is quite literally the size type.

Sure, size_t would work equally well. Having a Fortran background, i chose long long int as it is guaranteed to have 64 bits on any platform. Feel free to change.

Edit: OTOH, as naoccA, naoccB, nQ etc. are all signed integers, it is guaranteed that there will be no representation problems is someone assigns negative values to these (OK, why would you do so, but still) when long long is used as opposed to size_t.

@JonathonMisiewicz
Copy link
Contributor

My one request is that variables that are obviously used for indexing/lengths be size_t.

@andysim
Copy link
Member

andysim commented Aug 11, 2022

Just be super careful if there are any subtractions; the result of subtracting two unsigned quantities is itself unsigned and, if negative, it'll wrap around and give garbage. Therefore things like if (A - B > tol) should be if (A > B + tol). Probably not relevant for this case, but keep in mind that OpenMP loop iteration variables must be signed.

@hokru
Copy link
Member

hokru commented Aug 11, 2022

Ideally, I suppose, the variables should become size_t from the start. As already touched upon here #1764 (comment)

@loriab
Copy link
Member Author

loriab commented Aug 11, 2022

After wading into size_t guidance, the dangers of mixed signed/unsigned, and the deeper troubles of #1764 that need changes to the tensor classes, not just the dfocc.h ints, and not just the memory estimates, I think the long long int serves nicely for now.

Copy link
Contributor

@zachglick zachglick left a comment

Choose a reason for hiding this comment

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

I'm not familiar with dfocc, but LGTM

@loriab loriab merged commit 0b26bed into psi4:master Aug 19, 2022
@loriab loriab deleted the combo_diis_only_really branch August 19, 2022 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dfocc For issues in the DFOCC module. enhancement mugworthy testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coupled DIIS for dfocc
7 participants