Skip to content

Commit

Permalink
NoSymm separation
Browse files Browse the repository at this point in the history
NoSymm is not meant to be part of the opt or scf paramter combinations
  • Loading branch information
calvinp0 committed Nov 23, 2023
1 parent ed5e2b1 commit f108f62
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 16 deletions.
55 changes: 41 additions & 14 deletions arc/job/trsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def determine_ess_status(output_path: str,
error = 'The blank line after the coordinate section is missing, ' \
'or charge/multiplicity was not specified correctly.'
elif 'l103.exe' in line:
keywords = ['InternalCoordinateError', 'GL103']
keywords = ['InternalCoordinateError', 'GL103','NoSymm']
error = 'Internal coordinate error'
elif 'l108.exe' in line:
keywords = ['InputError', 'GL108']
Expand All @@ -112,7 +112,7 @@ def determine_ess_status(output_path: str,
elif 'l401.exe' in line:
keywords = ['GL401']
elif 'l502.exe' in line:
keywords = ['SCF', 'GL502']
keywords = ['SCF', 'GL502', 'NoSymm']
error = 'Unconverged SCF'
elif 'l508.exe' in line:
keywords = ['no_xqc', 'GL508']
Expand Down Expand Up @@ -867,10 +867,10 @@ def trsh_ess_job(label: str,
if remove_checkfile:
logger_info.append('that failed with "Basis set data is not on the checkpoint file" by removing the checkfile.')

# Check if InternalCoordinateError is in the keyword or opt=(cartesian,nosymm)
# Check if InternalCoordinateError is in the keyword or opt=(cartesian)
ess_trsh_methods, trsh_keyword, couldnt_trsh = trsh_keyword_cartesian(job_status, ess_trsh_methods, job_type, trsh_keyword,couldnt_trsh)
if 'cartesian' in ess_trsh_methods:
logger_info.append('using opt=cartesian with nosyym')
logger_info.append('using opt=cartesian')
ess_trsh_methods, trsh_keyword, couldnt_trsh = trsh_keyword_intaccuracy(ess_trsh_methods, trsh_keyword, couldnt_trsh)
if 'int=(Acc2E=14)' in ess_trsh_methods:
logger_info.append('using int=(Acc2E=14)')
Expand All @@ -879,11 +879,16 @@ def trsh_ess_job(label: str,
ess_trsh_methods, trsh_keyword, couldnt_trsh = trsh_keyword_scf(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh)
if 'scf=(NDump=30)' in ess_trsh_methods:
logger_info.append('using scf=(NDump=30)')
if 'scf=(qc,nosymm)' in ess_trsh_methods:
logger_info.append('using scf=(qc,nosymm)')
if 'scf=(qc)' in ess_trsh_methods:
logger_info.append('using scf=(qc)')
if 'scf=(NoDIIS)' in ess_trsh_methods:
logger_info.append('using scf=(NoDIIS)')

# Check if NoSymm
ess_trsh_methods, trsh_keyword, couldnt_trsh = trsh_keyword_nosymm(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh)
if 'NoSymm' in ess_trsh_methods:
logger_info.append('using nosymm')

# Check if unconverged is in the keyword
ess_trsh_methods, trsh_keyword, fine, couldnt_trsh = trsh_keyword_unconverged(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh, fine)
if fine:
Expand Down Expand Up @@ -1540,18 +1545,25 @@ def trsh_keyword_checkfile(job_status, ess_trsh_methods, couldnt_trsh) -> Tuple[
"""
Check if the job requires removal of checkfile
"""
if 'CheckFile' in job_status.get('keywords', '') or 'checkfile=None' in ess_trsh_methods:
if 'CheckFile' in job_status.get('keywords', '') and 'checkfile=None' not in ess_trsh_methods:
ess_trsh_methods.append('checkfile=None')
couldnt_trsh = False
return True, ess_trsh_methods, couldnt_trsh
elif 'checkfile=None' in ess_trsh_methods:
couldnt_trsh = False
return True, ess_trsh_methods, couldnt_trsh

return False, ess_trsh_methods, couldnt_trsh

def trsh_keyword_intaccuracy(ess_trsh_methods, trsh_keyword, couldnt_trsh) -> Tuple[List, List, bool]:
"""
Check if the job requires change of 2 electron integral accuracy
"""
if 'int=(Acc2E=14)' in ess_trsh_methods:
if 'int=(Acc2E=14)' not in ess_trsh_methods:
ess_trsh_methods.append('int=(Acc2E=14)')
trsh_keyword.append('int=(Acc2E=14)')
couldnt_trsh = False
elif 'int=(Acc2E=14)' not in trsh_keyword and 'int=(Acc2E=14)' in ess_trsh_methods:
trsh_keyword.append('int=(Acc2E=14)')
couldnt_trsh = False

Expand All @@ -1563,11 +1575,12 @@ def trsh_keyword_cartesian(job_status, ess_trsh_methods, job_type, trsh_keyword:
"""
if 'InternalCoordinateError' in job_status['keywords'] \
and 'cartesian' not in ess_trsh_methods and job_type == 'opt':
trsh_keyword.append('opt=(cartesian,nosymm)')
ess_trsh_methods.append('cartesian')
trsh_keyword.append('opt=(cartesian)')
couldnt_trsh = False
elif 'opt=(cartesian,nosymm)' in ess_trsh_methods and \
job_type == 'opt':
trsh_keyword.append('opt=(cartesian,nosymm)')
elif 'cartesian' in ess_trsh_methods and \
job_type == 'opt' and 'cartesian' not in trsh_keyword:
trsh_keyword.append('opt=(cartesian)')
couldnt_trsh = False

return ess_trsh_methods, trsh_keyword, couldnt_trsh
Expand All @@ -1577,9 +1590,9 @@ def trsh_keyword_scf(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh) -
Check if the job requires change of scf
"""
scf_pattern = r"scf=\((.*?)\)" # e.g., scf=(xqc,MaxCycle=1000), will match xqc,MaxCycle=1000
if 'SCF' in job_status['keywords'] and 'scf=(qc,nosymm)' not in ess_trsh_methods:
if 'SCF' in job_status['keywords'] and 'scf=(qc)' not in ess_trsh_methods:
# try both qc and nosymm
ess_trsh_methods.append('scf=(qc,nosymm)')
ess_trsh_methods.append('scf=(qc)')
couldnt_trsh = False
elif 'SCF' in job_status['keywords'] and 'scf=(NDump=30)' not in ess_trsh_methods:
# Switching off Pulay's Direct Inversion
Expand Down Expand Up @@ -1607,3 +1620,17 @@ def trsh_keyword_unconverged(job_status, ess_trsh_methods, trsh_keyword, couldnt
fine = False

return ess_trsh_methods, trsh_keyword, fine, couldnt_trsh

def trsh_keyword_nosymm(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh) -> Tuple[List, List, bool]:
"""
Check if the job requires change of nosymm
"""
if 'NoSymm' in job_status['keywords'] and 'nosymm' not in ess_trsh_methods:
ess_trsh_methods.append('NoSymm')
trsh_keyword.append('nosymm')
couldnt_trsh = False
elif 'nosymm' not in trsh_keyword and any('NoSymm' in keyword for keyword in ess_trsh_methods):
trsh_keyword.append('nosymm')
couldnt_trsh = False

return ess_trsh_methods, trsh_keyword, couldnt_trsh
4 changes: 2 additions & 2 deletions arc/job/trsh_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,14 @@ def test_trsh_ess_job(self):
self.assertFalse(couldnt_trsh)

# Gaussian: test 2
job_status = {'keywords': ['InternalCoordinateError']}
job_status = {'keywords': ['InternalCoordinateError', 'NoSymm']}
output_errors, ess_trsh_methods, remove_checkfile, level_of_theory, software, job_type, fine, trsh_keyword, \
memory, shift, cpu_cores, couldnt_trsh = trsh.trsh_ess_job(label, level_of_theory, server, job_status,
job_type, software, fine, memory_gb,
num_heavy_atoms, cpu_cores, ess_trsh_methods)

self.assertTrue(remove_checkfile)
self.assertEqual(trsh_keyword, ['opt=(cartesian,nosymm)', 'int=(Acc2E=14)'] )
self.assertEqual(trsh_keyword, ['opt=(cartesian)', 'int=(Acc2E=14)', 'nosymm'] )

# Test Q-Chem
software = 'qchem'
Expand Down

0 comments on commit f108f62

Please sign in to comment.