MolSSI / QCEngine

Quantum chemistry program executor and IO standardizer (QCSchema).
https://molssi.github.io/QCEngine/
BSD 3-Clause "New" or "Revised" License
162 stars 78 forks source link

'psi4 --version' times out #404

Closed yurivict closed 8 months ago

yurivict commented 1 year ago

The timeout occurs when QCEngine is run from a psi4 testcase, see this psi4 report.

This equivalent code doesn't timeout:

from qcengine.programs.psi4 import Psi4Harness

print(f"psi4.version={Psi4Harness().get_version()}")

But when run from the testcase it times out:

[yuri@freebsd13 /usr/ports/science/psi4/work/psi4-1.8/samples/cc24]$ psi4 test.in
Traceback (most recent call last):
  File "/usr/local/bin/psi4", line 374, in <module>
    exec(content)
  File "<string>", line 31, in <module>
  File "/usr/local/lib/python3.9/site-packages/psi4/driver/driver.py", line 613, in gradient
    plan.compute()
  File "/usr/local/lib/python3.9/site-packages/psi4/driver/driver_findif.py", line 1308, in compute
    t.compute(client=client)
  File "/usr/local/lib/python3.9/site-packages/psi4/driver/task_base.py", line 201, in compute
    self.result = qcng.compute(
  File "/usr/local/lib/python3.9/site-packages/qcengine/compute.py", line 105, in compute
    output_data = executor.compute(input_data, config)
  File "/usr/local/lib/python3.9/site-packages/qcengine/programs/psi4.py", line 121, in compute
    pversion = parse_version(self.get_version())
  File "/usr/local/lib/python3.9/site-packages/qcengine/programs/psi4.py", line 90, in get_version
    exc["proc"].wait(timeout=30)
  File "/usr/local/lib/python3.9/subprocess.py", line 1189, in wait
    return self._wait(timeout=timeout)
  File "/usr/local/lib/python3.9/subprocess.py", line 1909, in _wait
    raise TimeoutExpired(self.args, timeout)

subprocess.TimeoutExpired: Command '['/usr/local/bin/psi4', '--version']' timed out after 30 seconds

Printing out the relevant lines from the Psithon --> Python processed input file:
    core.IO.set_default_namespace("h2o")
    core.set_global_option("REFERENCE", "uhf")
    core.set_global_option("BASIS", "DZ")
    core.set_global_option("ROOTS_PER_IRREP", [0, 0, 1, 0])
    analytic_grad = gradient('eom-ccsd')
--> findif_grad = gradient('eom-ccsd', dertype=0)
    compare_matrices(analytic_grad, findif_grad, 5, "UHF-EOM-CCSD finite-diff. (3-pt.) vs. analytic gradient to 10^-5")
    core.set_local_option("FINDIF", "POINTS", 5)
    findif_grad = gradient('eom-ccsd', dertype=0)
    compare_matrices(analytic_grad, findif_grad, 6, "UHF-EOM-CCSD finite-diff. (5-pt.) vs. analytic gradient to 10^-7")

!----------------------------------------------------------------------------!
!                                                                            !
!  Command '['/usr/local/bin/psi4', '--version']' timed out after 30 seconds !
!                                                                            !
!----------------------------------------------------------------------------!
loriab commented 8 months ago

I've tweaked psi4 --version so that it skips the import psi4 step that can be slow on network drives. It's https://github.com/psi4/psi4/pull/3064 that's in master and has been backported to the v1.8.2 _2 release on conda-forge.

Note that qcengine info and other uses of get_version() on the Psi4 harness will be less reliable indicators that psi4 is in working order (e.g., numpy might be missing or mkl libraries missing).