Skip to content

Commit

Permalink
Updated to stop skipping TS conf during TRSH and opt(cartesian)
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinp0 committed Dec 2, 2024
1 parent d5449cb commit 7b8e561
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
9 changes: 5 additions & 4 deletions arc/job/trsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def determine_ess_status(output_path: str,
error = 'GS2 Optimization Failure'
line = 'GS2 Optimization Failure'
break

if any([keyword in ['GL301', 'GL401'] for keyword in keywords]):
additional_info = forward_lines[len(forward_lines) - i - 2]
if 'No data on chk file' in additional_info \
Expand Down Expand Up @@ -1828,12 +1829,12 @@ def trsh_keyword_cartesian(job_status, ess_trsh_methods, job_type, trsh_keyword:
Check if the job requires change of cartesian coordinate
"""
if 'InternalCoordinateError' in job_status['keywords'] \
and 'cartesian' not in ess_trsh_methods:
ess_trsh_methods.append('cartesian')
and 'opt=(cartesian)' not in ess_trsh_methods:
ess_trsh_methods.append('opt=(cartesian)')
trsh_keyword.append('opt=(cartesian)')
couldnt_trsh = False
elif 'cartesian' in ess_trsh_methods and \
job_type == 'opt' and 'cartesian' not in trsh_keyword:
elif 'opt=(cartesian)' in ess_trsh_methods \
and 'opt=(cartesian)' not in trsh_keyword:
trsh_keyword.append('opt=(cartesian)')
couldnt_trsh = False

Expand Down
30 changes: 29 additions & 1 deletion arc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3483,6 +3483,8 @@ def troubleshoot_ess(self,
self.species_dict[label].checkfile = None
job.ess_trsh_methods = ess_trsh_methods

jobs_info = self.job_dict.get('TS0', {}).get('conf_opt', [])

if not couldnt_trsh:
self.run_job(label=label,
xyz=xyz,
Expand All @@ -3501,14 +3503,40 @@ def troubleshoot_ess(self,
cpu_cores=cpu_cores,
shift=shift,
)
elif self.species_dict[label].is_ts and not self.species_dict[label].ts_guesses_exhausted:

elif self.species_dict[label].is_ts and not self.species_dict[label].ts_guesses_exhausted and not any(self.is_job_running(jobs_info[job]) for job in jobs_info.keys()):
logger.info(f'TS {label} did not converge. '
f'Status is:\n{self.species_dict[label].ts_checks}\n'
f'Searching for a better TS conformer...')
self.switch_ts(label=label)

self.save_restart_dict()

###### TO BE MOVED
def is_job_running(self,job):
"""
Safely checks if the given job is in the 'running' state.
Parameters:
job: The job object containing the .job_status attribute.
Returns:
bool: True if the job is running, False otherwise.
"""
try:
if isinstance(job.job_status, list) and len(job.job_status) > 0:
return job.job_status[0].lower() == 'running'
except AttributeError:
# The job object does not have a 'job_status' attribute
pass
return False




#################


def troubleshoot_conformer_isomorphism(self, label: str):
"""
Troubleshoot conformer optimization for a species that failed isomorphic test in
Expand Down

0 comments on commit 7b8e561

Please sign in to comment.