Fix two chain-killing bugs in the PBS self-scheduling recipe - #211
Merged
Conversation
OwenPriceSkelly
force-pushed
the
fix-pbs-chain-recipe
branch
from
August 10, 2026 15:07
c6e70d0 to
5c1d59e
Compare
Two latent bugs in scripts/nightly_smoke_test.pbs broke every PBS chain
at generation 2 (found while building a sibling chain script):
1. SELF_PATH derived from PBS_O_WORKDIR is wrong for any job submitted
BY another PBS job: the child's PBS_O_WORKDIR is the parent job's
cwd, which is $HOME (PBS starts jobs there and the script never
cd's). So generation 2 pointed at $HOME/nightly_smoke_test.pbs, its
qsub failed, and set -euo pipefail killed the job before the
smoke-test ran — one generation, then a silent death. Fix: each
generation now hands the next one its location explicitly via
qsub -v SELF_PATH=... (the existing ${SELF_PATH:-...} default
already honors the override). CLUSTER rides along too, since PBS
doesn't propagate the environment down the chain and shared installs
need it on every generation.
2. The duplicate-chain guard queried qselect -s Q, but a job submitted
with -a sits in state W (waiting), not Q, so the guard never matched
anything. Fix: -s QW.
Also corrects the docs/header guidance that went with them: look for
the waiting (W) job when stopping a chain, and fast-test the handoff by
overriding RESCHEDULE_AT — qsub -a on the kickoff only delays
generation 1's start and tests nothing about the chain.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
OwenPriceSkelly
force-pushed
the
fix-pbs-chain-recipe
branch
from
August 12, 2026 18:46
5c1d59e to
725cc9a
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.
Summary
Two latent bugs in
scripts/nightly_smoke_test.pbsmeant every PBS chain ran exactly one generation, then died silently — generation 2 crashed before its payload and never scheduled generation 3.Bug 1 — self-path breaks at generation 2. The script located itself via
$PBS_O_WORKDIR, which is only the submit directory for the first, human-submitted generation. For a job submitted by another PBS job,PBS_O_WORKDIRis the parent job's cwd —$HOME, since PBS starts jobs there and the script nevercds. Generation 2'sqsubof the bogus$HOME/...path fails, andset -euo pipefailkills the job before the smoke-test runs. Fix: each generation passes the path down explicitly withqsub -v SELF_PATH=...; the existing${SELF_PATH:-...}default already honors the override.CLUSTERrides along in the same-v, since PBS doesn't propagate the environment down the chain and shared installs (sophia/polaris) need it on every generation — previously it would have silently reverted to the manifest default from generation 2 on.-vpasses only the listed variables, so nothing else about the job environment changes.Bug 2 — duplicate-chain guard never matched. The guard used
qselect ... -s Q, but a job submitted with-asits in state W (waiting), not Q, so the guard was a no-op. Fix:-s QW.Also corrects the guidance that went with them, in the script header and
docs/nightly-smoke-testing.md:RESCHEDULE_AT(viaqsub -v) so generation 1 schedules generation 2 a few minutes out — that exercises the actual handoff. The previously suggestedqsub -a <time>on the kickoff only delays generation 1's own start and tests nothing about the chain.The SLURM sibling (
nightly_smoke_test.sbatch) is unaffected: it recovers its path fromscontrol show joband SLURM propagates the submit environment by default.Test plan
bash -non the edited script.-v SELF_PATHhandoff +QWguard) is lifted from a sibling self-scheduling chain script developed against ALCF; the running Sophia/Polaris chains will be re-kicked-off with per-cluster copies of this fix, which exercises the generation 1 → 2 handoff for real.🤖 Generated with Claude Code