[WIP] shell: select task command from scheduler-matched slot label - #7799
Open
zekemorton wants to merge 2 commits into
Open
[WIP] shell: select task command from scheduler-matched slot label#7799zekemorton wants to merge 2 commits into
zekemorton wants to merge 2 commits into
Conversation
added 2 commits
September 2, 2026 16:38
Problem: Multi-task jobspecs bind commands to slot labels, but the shell only retains tasks[0], so it cannot select the matched task. Retain the tasks array and resolve the command for a supplied slot label, preserving the tasks[0] default. Add resolution tests. Assisted-by: Claude:claude-opus-4.8
Problem: The shell resolves task commands by slot label but does not read the label assigned to its rank by the scheduler. Read the rank's slot label from R scheduling metadata and use it to resolve the command. Keep the tasks[0] default when no label exists. Assisted-by: Claude:claude-opus-4.8
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7799 +/- ##
==========================================
- Coverage 83.84% 83.82% -0.02%
==========================================
Files 599 599
Lines 102687 102737 +50
==========================================
+ Hits 86099 86123 +24
- Misses 16588 16614 +26
🚀 New features to boost your workflow:
|
Contributor
|
We should get an issue open against RFC 20 (Rv1) to add the slot label. This would remove the need for the job shell to reach into an opaque, scheduler-specific Once the RFC 20 changes are merged, this PR could be updated and perhaps one of the Python schedulers or a test scheduler could be developed to emit the slot label in R for more complete end-to-end testing. |
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.
Summary
This PR adds the flux-core shell support needed to select a task command based on the slot alternative
matched by the scheduler.
It complements flux-sched#1550, which records the
matched flexible-slot label in the scheduler’s R metadata. Together, the changes allow a jobspec with
multiple
tasks[]entries—each associated with atasks[].slotlabel—to run the command corresponding tothe resource alternative selected at scheduling time.
Implementation
tasksarray during shell parsing, instead of retaining onlytasks[0].tasks[0]as the default command for ordinary single-task jobspecs.scheduling.graph.nodes[].metadata.ephemeral.slot_labelin R.
job->commandto the task whoseslotmatches that label before tasks are created. This meansexisting consumers of
job->command, including task argv construction and the default job name,automatically use the selected command.
command per rank.
Compatibility
Jobs without labeled task alternatives are unchanged:
tasks[0].rv1_nosched,also retain the
tasks[0]default.Testing
Adds unit coverage for multi-task jobspec parsing and command resolution, including:
tasks[0];Flux-sched companion PR here