diff --git a/arc/job/trsh.py b/arc/job/trsh.py index 23b8689920..e9638aee6b 100644 --- a/arc/job/trsh.py +++ b/arc/job/trsh.py @@ -208,6 +208,11 @@ def determine_ess_status(output_path: str, # ARC cannot run QChem without a valid license. Therefore, we raise an error. # The user should check that the license server is active and that the license file is valid. raise ValueError('QChem license error. Check the license file.') + elif 'Error within run_minimization with minimization method' in line: + # This error is unknown currently, so will try to run the job again. + keywords = ['Minimization'] + error = 'Error within run_minimization with minimization method' + break if 'MAXIMUM OPTIMIZATION CYCLES REACHED' in line or 'Maximum optimization cycles reached' in line: # ' Maximum number of iterations reached during minimization algorithm.' # ' Try to increase the number of max iterations or lower threshold for convergence criteria.' @@ -1005,6 +1010,27 @@ def trsh_ess_job(label: str, log_message += ' and SYM_IGNORE' trsh_keyword += '\n SYM_IGNORE True' logger.info(log_message) + elif 'Minimization' in job_status['keywords']: + # Uncertain what this error is, but assuming it's just an error that means we need to re-run the job under the same conditions + # However, if this error persists, we will determine that the job is not converging and so we will + # determine it cannot be run and will not try again + if 'Minimization' in job_status['error']: + logger.warning(f'Could not troubleshoot {job_type} job in {software} for {label} with same conditions - Minimization error persists') + couldnt_trsh = True + else: + log_message = f'Troubleshooting {job_type} job in {software} for {label} with same conditions' + if 'maxiter' in ess_trsh_methods: + log_message += ' and maxiter' + trsh_keyword = '\n MAX_SCF_CYCLES 1000' + if 'max_cycles' in ess_trsh_methods: + log_message += ' and max_cycles' + trsh_keyword = '\n GEOM_OPT_MAX_CYCLES 250' + if 'DIIS_GDM' in ess_trsh_methods: + log_message += ' and DIIS_GDM' + trsh_keyword = '\n SCF_ALGORITHM DIIS_GDM' + if 'SYM_IGNORE' in ess_trsh_methods: + log_message += ' and SYM_IGNORE' + trsh_keyword = '\n SYM_IGNORE True' elif 'SYM_IGNORE' not in ess_trsh_methods: # symmetry - look in manual, no symm if fails # change the SCF algorithm and increase max SCF cycles log_message = f'Troubleshooting {job_type} job in {software} for {label} using SYM_IGNORE'