Repository navigation
requestedWorkers(): the worker count clusterSetup() asks for - #72
Merged
Merged
Conversation
…place Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
… already trimmed and renamed) requestedWorkers() on clusterSetup()'s own .requestedHosts() result cut again after the rename to localhost, so 5 thisHost + 5 localhost under a localhost cap of 6 asked for 6, not 10. 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 #72 +/- ##
===============================================
- Coverage 77.34% 76.22% -1.13%
===============================================
Files 24 24
Lines 2256 2145 -111
===============================================
- Hits 1745 1635 -110
+ Misses 511 510 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
eliotmcintire
added a commit
that referenced
this pull request
Nov 18, 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 program that must know how many workers a fit will get, before the workers exist, can now ask. Until now only the cluster set-up code knew, so callers copied its rule and got it wrong for some inputs.
Affects: nothing changes in the clusters that are built; there is one new exported function.
Technical details
The rule for the worker count was inline in
clusterSetup()(R/clusterSetup.R:68,69,102): a single number ofcoresis that many"localhost", each host is cut tooptions(clusters.maxWorkersPerHost), and the planner is asked for the number of names when a host repeats, elsenCoresNeeded. fireSense_spreadFit restated it and missed repeated host names (rep("mega", 40): 40 workers, it gave 30).Fix:
requestedWorkers(cores, nCoresNeeded)holds the rule, andclusterSetup()calls it. The host cap is included, because it can cut the count, so the function gives the same numberclusterSetup()asks for (a cap message is printed as inclusterSetup()). The doc says so. It is what is asked for: the planner can still build fewer when memory or other clusters' bookings limit a host.NULLcores (no cluster) givesnCoresNeeded. The step that turnscoresinto host names,.requestedHosts(), is shared and idempotent.Reuses:
.trimToHostCap(),changeNodenameToLocalhost(), the existingplan_psock_min(total =)call; new:requestedWorkers(),.requestedHosts()and.workerTotal()(the count on hosts already trimmed, soclusterSetup()applies the cap once) (the rule was inline inclusterSetup(), nothing callable existed).Tests: new
tests/testthat/test-requestedWorkers.R(number,1L, distinct hosts, repeated hosts,NULL, cap, and thetotalclusterSetup()gives the planner, pinned to literal values that also pass on the base code).devtools::test(): base 1382 pass, 0 fail, 0 skip; branch 1401 pass, 0 fail, 0 skip.R CMD check --no-manual --no-tests(scratch library,_R_CHECK_FORCE_SUGGESTS_=falseasDTis not installed): base 0 errors, 0 warnings, 3 notes; branch 0 errors, 0 warnings, 2 notes.🤖 Generated with Claude Code
https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6