Hmmmm… I stand corrected!
It actually fell over due to “too many bad steps”, even though I’m totally convinced that it failed much much earlier before I increased GEOM_MAXITER to several thousand (and I overwrote the original output file!). (Post title changed to reflect a more general problem.)
It could be an issue I’ve come across before where I’ve started a job over ssh and then logged out. Any(?) python-side print() functions cause an exception because the terminal has closed. (I keep on meaning to look into that properly, rather than just commenting out a few print() lines in driver.py, etc.!)
Anyway, this is an input file I was using (based on the example mentioned above):
memory 34GB
import numpy as np
molecule mol {
C 0.000000 0.000000 0.000000
C 0.000000 0.000000 1.400000
C 1.212436 0.000000 2.100000
C 2.424871 0.000000 1.400000
C 2.424871 0.000000 0.000000
C 1.212436 0.000000 -0.700000
H -0.943102 0.000000 1.944500
H 1.212436 0.000000 3.189000
H 3.367973 0.000000 1.944500
H 3.367973 0.000000 -0.544500
H 1.212436 0.000000 -1.789000
C -1.299038 0.000000 -0.750000
C -2.511474 0.000000 -0.050000
C -3.723909 0.000000 -0.750000
C -3.723909 0.000000 -2.150000
C -2.511474 0.000000 -2.850000
C -1.299038 0.000000 -2.150000
H -2.511474 0.000000 1.039000
H -4.667011 0.000000 -0.205500
H -4.667011 0.000000 -2.694500
H -2.511474 0.000000 -3.939000
H -0.355936 0.000000 -2.694500
symmetry c1
}
set {
basis cc-pvdz
intrafrag_step_limit 0.1
# Needed or it falls over after a couple of steps!
fixed_coord_force_constant = 160.
}
dihedrals = np.arange(0, 360)
PES = []
set optking {
dynamic_level = 1
}
for phi in dihedrals:
my_string = "2 1 12 13 " + str(phi)
set optking fixed_dihedral = $my_string
E = opt('mp2')
PES.append((phi, E))
print("\n\tcc-pVDZ SCF energy as a function of phi\n")
for point in PES:
print("\t%5.1f%20.10f" % (point[0], point[1]))
It eventually exits with:
Energy change for the previous step:
Projected : -0.7803579448
Actual : 0.0001661772
The BAD_STEP_EXCEPTion handler:
Energy has increased in a minimization.
Dynamic level is 7.
Consecutive backsteps is 1.
The INTCO_EXCEPTion handler:
Too many bad steps.
Dynamic level is 7.
exc.g_really_quit() is 0.
**** Optimization has failed! (in 5 steps) ****
--------------------------
OPTKING Finished Execution
--------------------------
Removing binary optimization data file.
Cleaning optimization helper files.
PsiException: Could not converge geometry optimization in 56 iterations.
Traceback (most recent call last):
File "/home/laz/miniconda3/bin/psi4", line 287, in <module>
exec(content)
File "<string>", line 59, in <module>
File "/home/laz/miniconda3/lib//python3.6/site-packages/psi4/driver/driver.py", line 1155, in optimize
raise OptimizationConvergenceError("""geometry optimization""", n - 1, wfn)
psi4.driver.p4util.exceptions.OptimizationConvergenceError: Could not converge geometry optimization in 56 iterations.
This is after optimising 181 points along the set of dihedrals, with each point taking 5 or fewer steps to converge.
I’ll dig into it more deeply to see if I can work out what’s failing at that point. (I suspect wrapping the opt() call in a try/except pair could be prudent anyway!)
I’ve set it going again using scf instead of mp2 (and not adjusting GEOM_MAXITER) to see if it fails at the same point…