Skip to content

Test scheduler improvements - #5045

Open
jgfouca wants to merge 4 commits into
masterfrom
jgfouca/test_sched_imprv
Open

Test scheduler improvements#5045
jgfouca wants to merge 4 commits into
masterfrom
jgfouca/test_sched_imprv

Conversation

@jgfouca

@jgfouca jgfouca commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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

  • My code follows the style guidelines of this project (black formatting)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that exercise my feature/fix and existing tests continue to pass
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding additions and changes to the documentation

@jgfouca
jgfouca requested review from jasonb5 and rljacob and a balanced review from Copilot August 31, 2026 20:16
@jgfouca jgfouca self-assigned this Aug 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 thread CIME/XML/env_batch.py
Comment thread CIME/XML/env_batch.py
Comment on lines +852 to +856
else:
expect(
job, "If not following workflow, please specific which job to submit"
)
jobs = [(job, None)]
Comment thread CIME/get_tests.py
Comment on lines +254 to 255
machobj = Machines(machine=machine) if machobj is None else machobj
machine = machobj.get_machine_name()
Comment thread CIME/utils.py
pass


class SectionTimer:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants