Skip to content

Commit

Permalink
Untested implementation of convergence check
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristaps Ermanis committed Jun 17, 2019
1 parent 2ec17cd commit ad8bcd0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
26 changes: 26 additions & 0 deletions Gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,32 @@ def SetupOptCalcs(Isomers, settings):
return Isomers


def Converged(Isomers):

jobdir = os.getcwd()

if not os.path.exists('opt'):
os.chdir(jobdir)
return False

os.chdir('opt')

for iso in Isomers:
for num in range(0, len(iso.Conformers)):
filename = iso.BaseName + 'ginp' + str(num + 1).zfill(3)

if os.path.exists(filename + '.out'):
if IsGausConverged(filename + '.out') == False:
os.chdir(jobdir)
return False
else:
os.chdir(jobdir)
return False

os.chdir(jobdir)
return True


def RunNMRCalcs(Isomers, settings):

jobdir = os.getcwd()
Expand Down
3 changes: 2 additions & 1 deletion GaussianDarwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,15 @@ def RunBatchOnDarwin(findex, GausJobs, settings):
not JobFinished[job[:-3] + 'out']]
if n2complete != len(Jobs2Complete):
n2complete = len(Jobs2Complete)
print(str(n2complete) + " remaining.")
print(str(n2complete) + " Gaussian jobs remaining.")

QRes = CheckDarwinQueue(JobIDs, settings)
if QRes != OldQRes:
if QRes[0] < 0:
QRes = OldQRes
else:
OldQRes = QRes
print('Darwin queue:')
print('Pending: ' + str(OldQRes[0]) + ', Running: ' + str(OldQRes[1]) + ', Not in queue: ' + str(OldQRes[2]))


Expand Down
4 changes: 4 additions & 0 deletions PyDP4.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ def main(settings):

Isomers = DFT.ReadGeometries(Isomers)

#Add convergence check here before continuing with calcs!
if DFT.Converged(Isomers) == False:
print('Some of the conformers did not converge, quitting...')

# Run DFT single-point energy calculations, if requested
if ('e' in settings.Workflow):
print('\nSetting up energy calculations...')
Expand Down

0 comments on commit ad8bcd0

Please sign in to comment.