shell: determine node & core resource counts from R during init #6705
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.
Problem: counts for resources are currently being parsed only from jobspec, but if/once ranges are used then values cannot be determined.
Modify shell init data flow to use the actual allocation from the scheduler in R, if present, to determine resource counts for nodes & cores in
jobspec_parse
.As a first step, this checks whether a resource set struct was passed to
jobspec_parse
, and otherwise leaves the original codepath unchanged. The slot count must still be parsed from the jobspec regardless, because it is missing from R.The concept for this is also essentially separated off from #6632, albeit with a fair bit of re-working to keep the changes as minimal as possible. Because
flux-sched
already has basic support for ranges, this PR already allows jobspec with ranges for nodes and/or cores to run successfully.