Repository navigation
No memory or core headroom inside a Slurm job - #71
Merged
Merged
Conversation
A Slurm job owns its allocation, so .limitToJob() flags the probe (inSlurmJob) and every CPU of the job is free; .fitCapacity() keeps no clusters.memoryHeadroom on such a host. Outside Slurm nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
… when the job's memory limit is unknown Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #71 +/- ##
===============================================
+ Coverage 77.30% 77.34% +0.04%
===============================================
Files 24 24
Lines 2252 2256 +4
===============================================
+ Hits 1741 1745 +4
Misses 511 511 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… other users (.keepFreeCores(), .inSlurmJob() shared by both caps) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
eliotmcintire
added a commit
that referenced
this pull request
Nov 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
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.
A cluster job on a supercomputer owns the memory and CPUs it was given, but the allocator still held back a tenth of the memory as if other people shared the machine. That left a 40-worker fit waiting over an hour for a place that had plenty of room.
Affects: Fits run inside a Slurm job can now use the job's whole allocation (about 4 more 10 GB workers on a 454 GB job); runs outside Slurm are unchanged.
Technical details
Defect:
R/estimateCluster.R:599-600(.fitCapacity()) subtractedclusters.memoryHeadroom * mem_total_gbon every host, and.probeHost()(R/estimateCluster.R:477-480) scaled free cores byfraction, also inside a job (GPSC 2026-11-14: 454G job, 437 GB free, 10 GB workers, capped at 39 of 40).Fix:
.limitToJob()(R/slurmAllocation.R) now marks the probeinSlurmJob, sets all the job's CPUs free (whole node or not) and zeroes the load..nodeTable()carries it asin_slurm_job;.fitCapacity()andfreeCoresLessReserved()keep no memory headroom and nokeepFreeCoresfor those hosts (new helpers.inSlurmJob(),.keepFreeCores(), shared by both). A job whose memory limit cannot be read is not flagged.reserveCapacity()goes through.fitCapacity(), so it follows. The ledger format is unchanged. Docs and NEWS updated.Tests: new test in
test-slurmAllocation.R(454 GB, 437 GB free, 10 GB per worker: 43 inside a faked job, 39 outside); it fails ondevelopment(39 vs 43). Two older tests that expected the old headroom were updated. Fulldevtools::test(): base 1375 expectations, branch 1381, 0 failures on both.R CMD check --no-manual(DT not installed, so_R_CHECK_FORCE_SUGGESTS_=false): 0 errors, 0 warnings, 3 existing notes.Reuses:
.slurmAllocation(),.limitToJob(),.probeHost(),.nodeTable(),.fitCapacity(); new:.inSlurmJob()and.keepFreeCores(), two one-line helpers so the three caps read the flag one way.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6