Skip to content

Commit

Permalink
TrshQCHEM: Added Minimization Error
Browse files Browse the repository at this point in the history
'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
remove 'break'
  • Loading branch information
calvinp0 committed Jul 31, 2023
1 parent 659ad74 commit 270777f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions arc/job/trsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -992,6 +997,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'
Expand Down

0 comments on commit 270777f

Please sign in to comment.