Fix orca ess status - #928
Open
calvinp0 wants to merge 3 commits into
Open
Conversation
…ocks determine_ess_status() mined the Orca SCF block for an initial/final energy pair to run its divergence heuristic. Two ways that crashed on a normally terminated run: 1. The scan for the first SCF iteration energy assumed the line immediately following the incremental-Fock marker holds one. Orca may print a SOSCF header and a separator in between, and the separator holds a single token, so `forward_lines[j + 1].split()[1]` raised IndexError. The loop was also unbounded and could only terminate by raising. 2. `scf_energy_last_iteration` was assigned only inside the 'TOTAL SCF ENERGY' branch but read whenever an initial energy was found, so a log with a parseable iteration line and no 'TOTAL SCF ENERGY' header raised UnboundLocalError. Neither exception is caught by any caller (determine_job_status() catches only IOError), so either one aborts the whole ARC run. Scan forward with a bounded loop that skips lines too short to hold an energy, initialize both energies to None, and require both before forming the ratio; a normally terminated run with nothing to compare is simply 'done'. Verified against every Orca fixture under arc/testing/ that contains the incremental-Fock marker: results are unchanged on all of them, including the SCF blow-up detection in orca_scf_blow_up_error.log. Only the NEB log changes behavior, from IndexError to 'done'. Both SCF edge cases are pinned by fixtures derived from real Orca NEB output (arc/testing/neb/neb_res.out truncated to leave the SCF block incomplete) rather than hand-written logs: neb_scf_no_iteration_line.out covers the scan, neb_scf_no_total_energy.out covers the both-energies guard.
determine_ess_status() dispatches on an exact software name ('gaussian',
'qchem', 'orca', 'molpro', 'terachem'). A TS-search adapter that wraps an ESS
reports its own adapter name, so OrcaNEBAdapter passed 'orca_neb', matched no
branch, and fell through to the terminal `return '', list(), '', ''`. A
normally terminated NEB run was therefore reported with an empty status rather
than 'done', and its errors (SCF divergence, MDCI, memory) were never
classified at all.
Add an `ess_software` property on JobAdapter that defaults to the adapter's own
name -- correct for adapters that ARE an ESS -- and have the ESS status call
sites use it, so an adapter wrapping an ESS can declare which log parser
applies. OrcaNEBAdapter overrides it to 'orca'; its output file is already
Orca's input.log.
Note that Orca NEB now takes part in Orca's ESS error handling like any other
Orca job. In particular a 'Syntax' keyword raises JobError, which
Scheduler.end_job turns into a re-run; NEB inputs carry version-sensitive
simple-input keywords, so that path is more reachable here than for a plain
Orca job.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #928 +/- ##
=======================================
Coverage 63.43% 63.43%
=======================================
Files 114 114
Lines 38325 38336 +11
Branches 10030 10031 +1
=======================================
+ Hits 24312 24320 +8
- Misses 11096 11099 +3
Partials 2917 2917
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
calvinp0
force-pushed
the
fix_orca_ess_status
branch
2 times, most recently
from
July 28, 2026 13:07
1c57ec7 to
ed0277c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request improves how the code determines and handles the electronic-structure software (ESS) identity for job adapters, especially for cases where an adapter wraps another ESS (like Orca NEB using Orca logs). It also makes the Orca SCF energy parsing logic more robust and adds comprehensive tests to cover tricky log file formats and edge cases.
Job Adapter and ESS Software Identity:
ess_softwareproperty to the baseJobAdapterclass, defaulting to the adapter's own name, and overridden inOrcaNEBAdapterto return'orca', ensuring correct dispatch to ESS log parsers. [1] [2]_check_job_ess_statusto useess_softwareinstead ofjob_adapter, so that status checks use the correct ESS name even for adapters that wrap another ESS. [1] [2]Orca SCF Energy Parsing Improvements:
determine_ess_statusto handle Orca NEB log files where the first SCF iteration line may not immediately follow the expected marker, and to avoid errors if energy lines are missing. Now, if either the initial or final SCF energy is missing but the job terminated normally, the status is still reported as'done'. [1] [2]Testing Enhancements:
orca_neb_test.pyto verify that Orca NEB jobs are properly recognized as'done'when the underlying Orca log terminates normally, and that the adapter/ESS identity logic is correct.trsh_test.pyto cover Orca NEB log edge cases, including incomplete SCF blocks and missing energy lines, ensuring the parser never raises errors in these cases and always returns'done'for normal terminations. [1] [2]