Skip to content

Batch fixes: stale job records, readable job names, XYZ count check, quieter job logs - #143

Merged
NCCU-Schultz-Lab merged 3 commits into
mainfrom
claude/batch-bugs-b29-b211
Oct 11, 2026
Merged

NCCU-Schultz-Lab merged 3 commits into
mainfrom
claude/batch-bugs-b29-b211

Conversation

@NCCU-Schultz-Lab

@NCCU-Schultz-Lab NCCU-Schultz-Lab commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Three batch-workflow bug fixes from M-BATCH2 (B2.9, B2.11) and a log cleanup.

Changes

  • Concurrent-job limit (B2.9): quantui submit and Resubmit sync job states with the SLURM queue before counting active jobs. With no app open, finished jobs stayed "submitted" in the registry. After two submissions, every further one was refused. A failed queue poll leaves the registry as it is.

  • Job names (B2.11): Pople bases are written the usual way in job and folder names:

    • 6-31G* → 6-31Gd
    • 6-31G(d,p) → 6-31Gdp
    • 6-31+G* → 6-31pGd

    These used to come out as 6-31Gx and 6-31Gxdxpx. Names stay distinct from 6-31G. The quantui-batch launcher gets the same change.

  • XYZ atom count (B2.11): quantui submit and quantui-batch refuse an XYZ file whose first line gives a different atom count from the atoms listed. Such a file is cut off or padded, and an unattended job shouldn't run it. The count is checked before the charge/multiplicity check, so the error names the real cause. The app still only warns, since there the student sees the structure.

  • Job logs: PySCF's input dump copied the running script into every SCF-based batch log. In the worker that meant about 900 lines of worker.py. A new session_calc.build_mole() hides the script only while the molecule is built. PySCF's version info and [INPUT] summary are still logged. The app was unaffected.

Testing

  • pytest -m "not network": 3827 passed, 19 skipped, 0 failed.
  • ruff, black and mypy (run as in CI): clean.
  • New tests:
    • finished jobs stop counting toward the limit;
    • a dispatch with two stale records goes through (the old code refuses it);
    • basis spellings in job names, with launcher parity;
    • cut-off XYZ files are refused;
    • the script dump is gone and the input summary is kept.
  • Real worker run, water frequency job: 229-line live.log, no source dump, [INPUT] num. atoms present.

Authorship

  • Claude (Opus 5.5): code edits, review, and conceptual discussion
  • Jonathan Schultz: overall vision, planning, review, and orchestration

NCCU-Schultz-Lab and others added 3 commits October 11, 2026 03:10
Registry records leave submitted/running only when something polls the
queue. The app does; `quantui submit` from a terminal never did, so
finished jobs kept counting toward QUANTUI_MAX_CONCURRENT_JOBS and, after
two submissions, every further submit was refused. dispatch() and
resubmit() now call refresh_registry_statuses() before counting
(best-effort: a failed poll leaves the registry as it is).

Tests: finished jobs stop counting, a failed poll keeps the count, and a
dispatch with two stale records succeeds (refused on the old code).

Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration

Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ch (B2.11)

- Job and folder names wrote every unsafe basis character as "x"
  (6-31G* -> 6-31Gx, 6-31G(d,p) -> 6-31Gxdxpx). slurm_utils.job_name_basis
  uses the usual abbreviation instead: 6-31Gd, 6-31Gdp, 6-31pGd; still
  distinct from 6-31G. Same in the quantui-batch launcher port.
- An XYZ whose first line gives a different atom count from the atoms
  listed is now an error for `quantui submit` and `quantui-batch` (it was
  a log line, resp. a warning): a cut-off file must not run unattended.
  The count is checked before the charge/multiplicity check, since a
  cut-off file's odd electron count is a symptom. The app still warns.
- test_jobdirs' sbatch mock hands job ids to sbatch only; since B2.9 the
  submit path polls the queue first, which consumed an id.

Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration

Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
PySCF's Mole.build() runs dump_input() at verbose > NOTE, which writes
the whole __main__ file into the output. QuantUI builds with verbose=4
and the job log as stdout, so in the batch worker (where __main__ is
worker.py) every single point, frequency, NMR and TD-DFT run added ~900
lines of source to live.log (a toluene frequency log reached 3763
lines). In Jupyter/Voila __main__ has no file, so the app was unaffected.

session_calc.build_mole() hides __main__.__file__ for the build only;
the system info and [INPUT] summary are still written. Used by the four
log-writing build sites. Real worker run, water frequency: 229-line log,
no source dump, "[INPUT] num. atoms" present.

Contributions:
- Claude (Opus 5.5): code edits, review, and conceptual discussion
- Jonathan Schultz: overall vision, planning, review, and orchestration

Co-authored-by: Jonathan Schultz <nccu-schultz-lab@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@NCCU-Schultz-Lab
NCCU-Schultz-Lab merged commit fc6b58c into main Oct 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant