-
Notifications
You must be signed in to change notification settings - Fork 24
Improve trsh attempts reporting #871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1137,10 +1137,22 @@ def trsh_ess_job(label: str, | |||||||||||||||||||||||||||
| couldnt_trsh = True | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| if couldnt_trsh: | ||||||||||||||||||||||||||||
| logger.error(f'Could not troubleshoot geometry optimization for {label}! ' | ||||||||||||||||||||||||||||
| f'Tried troubleshooting with the following methods: {ess_trsh_methods}') | ||||||||||||||||||||||||||||
| # Count and remove 'trsh_attempt' entries for cleaner reporting | ||||||||||||||||||||||||||||
| trsh_attempt_count = ess_trsh_methods.count('trsh_attempt') | ||||||||||||||||||||||||||||
| filtered_methods = [method for method in ess_trsh_methods if method != 'trsh_attempt'] | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| # Build the message with the count and filtered methods | ||||||||||||||||||||||||||||
| if trsh_attempt_count > 0 and filtered_methods: | ||||||||||||||||||||||||||||
| message = f'Tried troubleshooting {trsh_attempt_count} times, with the following methods: {filtered_methods}' | ||||||||||||||||||||||||||||
| elif trsh_attempt_count > 0: | ||||||||||||||||||||||||||||
| message = f'Tried troubleshooting {trsh_attempt_count} times' | ||||||||||||||||||||||||||||
|
Comment on lines
+1143
to
+1148
|
||||||||||||||||||||||||||||
| # Build the message with the count and filtered methods | |
| if trsh_attempt_count > 0 and filtered_methods: | |
| message = f'Tried troubleshooting {trsh_attempt_count} times, with the following methods: {filtered_methods}' | |
| elif trsh_attempt_count > 0: | |
| message = f'Tried troubleshooting {trsh_attempt_count} times' | |
| attempt_label = 'time' if trsh_attempt_count == 1 else 'times' | |
| # Build the message with the count and filtered methods | |
| if trsh_attempt_count > 0 and filtered_methods: | |
| message = f'Tried troubleshooting {trsh_attempt_count} {attempt_label}, with the following methods: {filtered_methods}' | |
| elif trsh_attempt_count > 0: | |
| message = f'Tried troubleshooting {trsh_attempt_count} {attempt_label}' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3554,7 +3554,8 @@ def troubleshoot_ess(self, | |
|
|
||
| level_of_theory = Level(repr=level_of_theory) | ||
| logger.info('\n') | ||
| warning_message = f'Troubleshooting {label} job {job.job_name} which failed' | ||
| # log job failure information before troubleshooting | ||
| warning_message = f'{label} Job {job.job_name} failed' | ||
| if job.job_status[1]["status"] and job.job_status[1]["status"] != 'done': | ||
| warning_message += f' with status: "{job.job_status[1]["status"]},"' | ||
| if job.job_status[1]["keywords"]: | ||
|
|
@@ -3593,6 +3594,8 @@ def troubleshoot_ess(self, | |
| f'Reached max troubleshooting attempts ({max_ess_trsh}).') | ||
| self.output[label]['errors'] += f'Error: ESS troubleshooting attempts exhausted for {label} {job.job_type}; ' | ||
| return | ||
| logger.warning(f'Troubleshooting {label} job {job.job_name} ' | ||
| f'(attempt number {trsh_attempts + 1}).') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is more a readability suggestion but we could do something like this: That way if someone were to look at this code in the future, it would be quick to see that its the next attempt |
||
| job.ess_trsh_methods.append('trsh_attempt') | ||
|
|
||
| # Determine if the species is a hydrogen atom (or its isotope). | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a time when there would be no methods? I mean if it did attempt to troubleshoot x number of times, then it would have used a method, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, when there is no methods applied, so no troubleshoot could be done (an edge case I guess?) Should then the message be something like "No applicable troubleshooting methods found".