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

Docs: Add note to use psi4.core.clean after calculations #3164

Open
KB1RD opened this issue May 6, 2024 · 0 comments
Open

Docs: Add note to use psi4.core.clean after calculations #3164

KB1RD opened this issue May 6, 2024 · 0 comments

Comments

@KB1RD
Copy link

KB1RD commented May 6, 2024

I am new to Psi4 and quantum chemistry in general. The PsiAPI tutorial is helpful in getting started, but doesn't mention use of psi4.core.clean(). I can't find any mention of this function in the docs, except here.

A newbie like me may try to run two calculations in series. In my case, I got:

Traceback (most recent call last):
  File "test.py", line 47, in <module>
    h2oi = energyFromGeometryFile('geometries/01.xyz', method="ccsd")
  File "test.py", line 27, in energyFromGeometryFile
    return calculateEnergy(text, method, basis)
  File "test.py", line 12, in calculateEnergy
    e = psi4.energy(method + '/' + basis)
  File "/home/ubuntu/build/build/stage/lib/psi4/driver/driver.py", line 525, in energy
    wfn = procedures['energy'][lowername](lowername, molecule=molecule, **kwargs)
  File "/home/ubuntu/build/build/stage/lib/psi4/driver/procrouting/proc.py", line 871, in select_ccsd
    return func(name, **kwargs)
  File "/home/ubuntu/build/build/stage/lib/psi4/driver/procrouting/proc.py", line 2894, in run_ccenergy
    ref_wfn = scf_helper(name, **kwargs)  # C1 certified
  File "/home/ubuntu/build/build/stage/lib/psi4/driver/procrouting/proc.py", line 1887, in scf_helper
    e_scf = scf_wfn.compute_energy()
  File "/home/ubuntu/build/build/stage/lib/psi4/driver/procrouting/scf_proc/scf_iterator.py", line 82, in scf_compute_energy
    self.initialize()
  File "/home/ubuntu/build/build/stage/lib/psi4/driver/procrouting/scf_proc/scf_iterator.py", line 197, in scf_initialize
    self.form_H()
RuntimeError: 
Fatal Error: PSIO_ERROR: 18 (Incorrect block end address)

Practical advice: This error is probably disk related. First, check that your scratch isn’t full.
Second, make sure that you’re setting scratch ("psi4 -s" or "export PSI_SCRATCH") rather than letting it 
default to /tmp. Third, run the job again to see if the error is reproducible.
If it persists, finally, file an issue.

Error occurred in file: /home/ubuntu/build/psi4/src/psi4/libpsio/error.cc on line: 142
The most recent 5 function calls were:

psi::PsiException::PsiException(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char const*, int)
psi::PSIO::write(unsigned long, char const*, char*, unsigned long, psi::psio_address, psi::psio_address*)
psi::PSIO::write_entry(unsigned long, char const*, char*, unsigned long)
psi::Matrix::save(psi::PSIO*, unsigned long, psi::Matrix::SaveType)

Turns out, this is caused by not running psi4.core.clean() between these calculations. To find this function, I took a lucky guess that Psi4 had some kind of cleanup function since independent calculations succeeded. Instead, this should probably be in: https://psicode.org/psi4manual/master/psiapi.html

I am fully willing to submit a PR with this documentation, but I don't have much experience with Psi4/QC knowledge in general, so I'm worried I might leave something out.

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

No branches or pull requests

1 participant