Skip to content

No memory or core headroom inside a Slurm job - #71

Merged
eliotmcintire merged 3 commits into
developmentfrom
slurmNoHeadroom
Nov 14, 2026
Merged

eliotmcintire merged 3 commits into
developmentfrom
slurmNoHeadroom

Conversation

@eliotmcintire

@eliotmcintire eliotmcintire commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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()) subtracted clusters.memoryHeadroom * mem_total_gb on every host, and .probeHost() (R/estimateCluster.R:477-480) scaled free cores by fraction, 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 probe inSlurmJob, sets all the job's CPUs free (whole node or not) and zeroes the load. .nodeTable() carries it as in_slurm_job; .fitCapacity() and freeCoresLessReserved() keep no memory headroom and no keepFreeCores for 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 on development (39 vs 43). Two older tests that expected the old headroom were updated. Full devtools::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

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
@eliotmcintire eliotmcintire added bug Something isn't working backwards compatible Existing code and results keep working unchanged labels Nov 14, 2026
… 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

codecov Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.34%. Comparing base (0b19294) to head (930109d).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

… 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
eliotmcintire merged commit 3dd04b2 into development Nov 14, 2026
14 checks passed
@eliotmcintire
eliotmcintire deleted the slurmNoHeadroom branch November 14, 2026 15:04
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backwards compatible Existing code and results keep working unchanged bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant