From 39d23ad03a829a8f17083bae111c4950f1b5d309 Mon Sep 17 00:00:00 2001 From: Calvin Pieters Date: Mon, 31 Jul 2023 09:56:42 +0300 Subject: [PATCH] TrshQCHEM: Added Minimization Error 'Error within run_minimization with minimization method' - Not certain what this error requires, and also if we should troubleshoot it if the job type is a 'conformer'. For now, we will re-run the job under the same conditions and if it fails again, we will declare it not possible to troubleshoot --- arc/job/trsh.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arc/job/trsh.py b/arc/job/trsh.py index 6716437659..4286a29fcb 100644 --- a/arc/job/trsh.py +++ b/arc/job/trsh.py @@ -207,6 +207,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.' @@ -992,6 +997,28 @@ 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 + break + 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'