Skip to content

Commit

Permalink
cleans
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 committed Sep 1, 2024
1 parent 0a8e41f commit a616db6
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions arc/job/trsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,6 @@ def trsh_ess_job(label: str,
logger_phrase = f'Troubleshooting {job_type} job in {software} for {label}'
logger_info = []
couldnt_trsh = True
fine = fine
attempted_ess_trsh_methods = ess_trsh_methods.copy() if ess_trsh_methods else None
# Check if Checkfile removal is in the keywords. Removal occurs when:
# - Basis Set Mismatch
Expand Down Expand Up @@ -963,7 +962,10 @@ def trsh_ess_job(label: str,
formatted_string += f', {i}'
logger_info.append(formatted_string)


# Remove qc from ess_trsh_methods if 'no_qc' is in the keywords
ess_trsh_methods, trsh_keyword, couldnt_trsh = trsh_keyword_no_qc(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh)
if 'no_qc' in ess_trsh_methods:
logger_info.append('removed QC')

Check warning on line 968 in arc/job/trsh.py

View check run for this annotation

Codecov / codecov/patch

arc/job/trsh.py#L968

Added line #L968 was not covered by tests


# Check if memory is in the keyword
Expand Down Expand Up @@ -1820,7 +1822,7 @@ 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)' not in ess_trsh_methods:
if 'SCF' in job_status['keywords'] and 'scf=(qc)' not in ess_trsh_methods and 'n_qc' not in ess_trsh_methods:
# try both qc and nosymm
ess_trsh_methods.append('scf=(qc)')
couldnt_trsh = False
Expand All @@ -1845,6 +1847,9 @@ def trsh_keyword_scf(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh) -
ess_trsh_methods.append('scf=(Noincfock)')
ess_trsh_methods.append('scf=(NoVarAcc)')
couldnt_trsh = False
if 'no_qc' in ess_trsh_methods and 'scf=(qc)' in ess_trsh_methods:
ess_trsh_methods.remove('scf=(qc)')
couldnt_trsh = False

Check warning on line 1852 in arc/job/trsh.py

View check run for this annotation

Codecov / codecov/patch

arc/job/trsh.py#L1851-L1852

Added lines #L1851 - L1852 were not covered by tests

if any('scf' in keyword for keyword in ess_trsh_methods):
scf_list = [match for element in ess_trsh_methods for match in re.findall(scf_pattern, element)] if any(re.search(scf_pattern, element) for element in ess_trsh_methods) else []
Expand Down Expand Up @@ -2011,3 +2016,16 @@ def prioritize_opt_methods(opt_methods):

return filtered_methods

def trsh_keyword_no_qc(job_status, ess_trsh_methods, trsh_keyword, couldnt_trsh) -> Tuple[List, List, bool]:
"""
When a job fails with no qc, there are two possible solutions based upon the error message:
1. If SCF fails, then try to change the algorithm to LQA.
2. If SCF fails, then try to change the algorithm to LQA.
"""
if 'no_xqc' in job_status['keywords'] and 'scf=(qc)' in ess_trsh_methods:
ess_trsh_methods.remove('scf=(qc)')
ess_trsh_methods.append('no_xqc')
couldnt_trsh = False

Check warning on line 2028 in arc/job/trsh.py

View check run for this annotation

Codecov / codecov/patch

arc/job/trsh.py#L2026-L2028

Added lines #L2026 - L2028 were not covered by tests


return ess_trsh_methods, trsh_keyword, couldnt_trsh

0 comments on commit a616db6

Please sign in to comment.