Skip to content

Commit

Permalink
Invalidate scan jobs that failed with internal coordinate error (L103)
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Jul 28, 2023
1 parent 65ee00d commit 5277e5a
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions arc/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2656,25 +2656,24 @@ def check_scan_job(self,
label (str): The species label.
job (JobAdapter): The rotor scan job object.
"""
# If the job has not converged, troubleshoot ESS.
# Besides, according to the experience, 'Internal coordinate error' cannot be handled by
# troubleshoot_ess() for scan jobs. It is usually related to bond or angle changes which
# messes up the internal coordinates during the scan. It can be resolved
# by conformer-based scan troubleshooting method, yet its energies are readable.
if job.job_status[1]['status'] != 'done' and job.job_status[1]['error'] != 'Internal coordinate error':
self.troubleshoot_ess(label=label,
job=job,
level_of_theory=job.level)
return None
# Otherwise, check the scan job quality.
invalidate, actions, energies, angles = False, list(), list(), list()
invalidation_reason, message = '', ''
if job.job_status[1]['status'] != 'done':
if job.job_status[1]['error'] == 'Internal coordinate error':
invalidate = True
invalidation_reason = 'Internal coordinate error; '
else:
self.troubleshoot_ess(label=label,
job=job,
level_of_theory=job.level)
return None

if job.rotor_index not in self.species_dict[label].rotors_dict.keys():
raise SchedulerError(f'Could not match rotor {job.rotor_index} of species {label} '
f'with pivots {self.species_dict[label].rotors_dict[job.rotor_index]["pivots"]} '
f'to any of the existing rotors in the species.\n'
f'The rotors dict of {label} is:\n{pprint.pformat(self.species_dict[label].rotors_dict)}')

invalidation_reason, message = '', ''
if self.species_dict[label].rotors_dict[job.rotor_index]['dimensions'] == 1:
# This is a 1D scan.
# Read energy profile (in kJ/mol), it may be used in the troubleshooting.
Expand Down Expand Up @@ -2728,7 +2727,7 @@ def check_scan_job(self,

if invalidate:
self.species_dict[label].rotors_dict[job.rotor_index]['success'] = False
self.species_dict[label].rotors_dict[job.rotor_index]['invalidation_reason'] = invalidation_reason
# self.species_dict[label].rotors_dict[job.rotor_index]['invalidation_reason'] = invalidation_reason
else:
self.species_dict[label].rotors_dict[job.rotor_index]['success'] = True
self.species_dict[label].rotors_dict[job.rotor_index]['symmetry'] = determine_rotor_symmetry(
Expand Down Expand Up @@ -2765,7 +2764,6 @@ def check_scan_job(self,
'original_dihedrals'],
)

# Save the restart dictionary
self.save_restart_dict()

def check_directed_scan(self, label, pivots, scan, energies):
Expand Down

0 comments on commit 5277e5a

Please sign in to comment.