Skip to content

sp run --in-allocation: run a campaign inside one SLURM allocation - #964

Open
cailmdaley wants to merge 3 commits into
developfrom
feat/sp-in-allocation
Open

cailmdaley wants to merge 3 commits into
developfrom
feat/sp-in-allocation

Conversation

@cailmdaley

@cailmdaley cailmdaley commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

sp run --in-allocation runs a whole campaign inside the SLURM allocation it is called from, under snakemake's local executor, so a campaign waits in the queue once instead of once per job.

Flag / behaviour What it does
--in-allocation --executor local --cores N --resources mem_mb=M, with N from the cpuset and M from the tightest cgroup memory limit less a reserve; later explicit flags win. Refuses to run outside an allocation.
default tile store $SLURM_TMPDIR/tile-store/<run>, so two campaigns can share one allocation (one srun step each); tile_store_root: still wins
resubmit after a timeout deletes tile_vignets.json for tiles with no final_cat (their node-local store died with the job) and releases a snakemake lock whose job has left the queue; any other lock stops the run. -n only reports.

workflow/README.md gains an "Execution mode: one allocation" section covering sizing (one node, ≤4 GB/core, the widest rule's last retry must fit) and the resume path.

Why now

Every v2 production batch on Nibi already runs through this branch: the integration branches g15 through g18 carry it, and g18 alone ran 33 one-node batches (~800 tiles, P3) with no run failures. It is the base of #954 (exposure stores node-local under --in-allocation, #953). This PR lands the mechanism production depends on, so that it stops being campaign-local.

Scope

  • In: workflow/bin/sp, workflow/README.md.
  • Out: the per-job SLURM executor path is unchanged; --in-allocation is opt-in.

Verification

  • Production: every P3 batch on Nibi ran through sp run --in-allocation on one 144-core node; g18's 33 batches (~800 tiles) had no run failures (surveyor's report, 11 Oct).
  • Not checked for this PR: whether a production batch has yet resumed through the timeout sweep. -n reports the sweep and lock release without acting.

Stacked after this: #954 → base moves to develop once this merges.


Claude (Opus 5.5) on behalf of Cail, from the Nibi scale-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SYQ7H2aF2jXdXv9FSKyagY

cailmdaley and others added 3 commits October 2, 2026 19:41
Runs both invocations under snakemake's local executor inside the
allocation sp is called from, so a small campaign pays one queue wait
instead of one per job. sp derives --cores from the cpuset and
--resources mem_mb from the tightest cgroup memory limit (less a
reserve), refuses to run outside an allocation, and defaults the
node-local tile store to $SLURM_TMPDIR/tile-store through the existing
tile_store_root rebind. README documents sizing and the resume caveat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dj4HnkNqqPkVCeDeUGEGuz
… per allocation

Data campaigns name node-local stores by bare tile id, so two campaigns
over the same tiles sharing one allocation would share stores. Default
to $SLURM_TMPDIR/tile-store/<run>, and document one srun step per
campaign.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dj4HnkNqqPkVCeDeUGEGuz
A job cut short by its time limit leaves two things a plain resubmission
trips over. Its node-local tile store is gone, so a tile whose
tile_vignets.json survived without a final_cat stops at tile.smk's
"vignette store is missing" guard; and a killed snakemake leaves its lock.
sp now deletes those manifests before the run, and records the job that
holds the state dir so that a lock whose job has left the queue is
released. Any other lock stops the run before anything is swept. With -n
both only report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8wdTpGpBtyK6uHwU7qWQW

This branch has not been deployed

No deployments
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