Skip to content

Power-law calibration: cap its processes like the threshold calibration - #85

Merged
eliotmcintire merged 1 commit into
developmentfrom
fix/powerlaw-fork-budget
Oct 19, 2026
Merged

eliotmcintire merged 1 commit into
developmentfrom
fix/powerlaw-fork-budget

Conversation

@eliotmcintire

Copy link
Copy Markdown
Collaborator

The new power-law calibration could start far too many processes on one machine. It started one per cluster host named in cores (15 in our runs) for every fit, ignoring the per-process limit we set, the memory left and other fits running on the same machine. It now uses the same limit as the existing threshold calibration.

Affects: power-law fits; how many processes the calibration starts, not its result (that does not depend on the number of processes).

Depends-on: PredictiveEcology/fireSenseUtils#168

Technical details

calibrationCores() (R/powerLawCalibration.R, from #84) took length(cores) capped at detectCores(). It is replaced by forkBudget(nTasks) (R/thresholdForks.R), which wraps the budget runSpreadWithoutDEoptim() already computed inline for the threshold self-calibration: thresholdForks() with the R heap, available memory, busy threads, detectCores() and options(mc.cores). Both callers now use it, so the code is not duplicated. calibratePowerLaw() itself runs in one process where forking is unavailable (Windows, RStudio; fireSenseUtils#168).

New test: forkBudget() honours options(mc.cores). Full module suite: 904 + 3 new expectations pass, 0 fail.

🤖 Generated with Claude Code

https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6

…hold calibration's memory/CPU/mc.cores caps

calibrationCores() forked one process per DEoptim host (15 in our runs) on the local machine, ignoring
options(mc.cores), memory and other fits on the host. forkBudget() wraps the budget the threshold
self-calibration already used (thresholdForks()), so both share it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
@eliotmcintire eliotmcintire added the bug Something isn't working label Oct 19, 2026
@eliotmcintire
eliotmcintire merged commit b028d6f into development Oct 19, 2026
9 checks passed
@eliotmcintire
eliotmcintire deleted the fix/powerlaw-fork-budget branch October 19, 2026 03:28
eliotmcintire added a commit that referenced this pull request Oct 19, 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

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant