Test scheduler improvements - #5045
Open
jgfouca wants to merge 4 commits into
Open
Conversation
jgfouca
requested review from
jasonb5 and
rljacob
and
a balanced review from Copilot
August 31, 2026 20:16
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Direct submission lacks job validation, and key new behaviors need regression tests.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Improves test scheduler startup and direct job submission behavior.
Changes:
- Reuses machine configuration and removes redundant sorting.
- Submits standalone jobs without workflow dependency analysis.
- Adds a section timing context manager.
File summaries
| File | Description |
|---|---|
CIME/XML/env_batch.py |
Adds direct single-job submission. |
CIME/utils.py |
Adds SectionTimer. |
CIME/test_scheduler.py |
Reuses machine data and updates task limits. |
CIME/scripts/create_test.py |
Removes redundant test sorting. |
CIME/get_tests.py |
Supports injected machine objects. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+852
to
+856
| else: | ||
| expect( | ||
| job, "If not following workflow, please specific which job to submit" | ||
| ) | ||
| jobs = [(job, None)] |
Comment on lines
+254
to
255
| machobj = Machines(machine=machine) if machobj is None else machobj | ||
| machine = machobj.get_machine_name() |
| pass | ||
|
|
||
|
|
||
| class SectionTimer: |
rljacob
approved these changes
Aug 31, 2026
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.
Description
Fix very poor performance on create_test/test_scheduler startup. The root cause was repeated initialization of Machine object which requires a lot of file I/O and XML stuff. Since test_scheduler already makes a Machine object, just reuse that one if possible.
Also, there is no need to sort test cases twice.
Also, when asking env_batch to submit a specific job without doing a full workflow sequence, it should always just do that job instead of doing a full dependency analysis.
Also, adds a simple context manager for timing sections of code.
Also, the default task-level parallelism in test_scheduler should be based off MAX_TASK_PER_NODE instead of MAX_MPITASKS_PER_NODE because the latter is very throttled for GPU.
Checklist