PSI4/Optking Timeout


I’m currently working on a high-throughput method using psi4 for multiple concurrent optimisatons using mpi4py and the optking package with psi4. One issue I am occasionally running into is psi4 calculations not crashing but stopping or sometimes simply just taking too long to complete relative to others and therefore taking up resources that another calculation could use.

Essentially I’m wondering if there is a way within psi4 or optking to place a timer upon a optking.optimize_psi4("B3LYP") or a"B3LYP") function call and have it cancel a particular job if it reaches a set time limit?

Thank you,

There is no build-in way to time-limit a psi4 call, but I think there should be python solution arounds.
A quick search on stackexchange gave this: python - How to limit execution time of a function call? - Stack Overflow, which looks reasonable.

Thank you for the link.

Hey all, I’m wondering if you were able to use the python time out solution to stop your calculation and save all of the partial optimization? Were you able to extract the scratch files and use those to restart the calculation?


Sorry I didn’t end up incorporating a timeout in the code/ couldn’t find an elegant way to do so. My compromise was running a second job alongside as a watcher essentially to spot any “rogue” calculations and treating those a failures so didn’t do any restarts.

Hope you sort what your working on.

1 Like