From a616db6726a0637217dcf8d0c6a9fc22032ed85e Mon Sep 17 00:00:00 2001 From: Calvin Date: Sun, 1 Sep 2024 10:34:56 +0300 Subject: [PATCH] cleans --- arc/job/trsh.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/arc/job/trsh.py b/arc/job/trsh.py index ecffcca42a..7261605a66 100644 --- a/arc/job/trsh.py +++ b/arc/job/trsh.py @@ -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 @@ -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 if memory is in the keyword @@ -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 @@ -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 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 [] @@ -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 + + + return ess_trsh_methods, trsh_keyword, couldnt_trsh