Uh oh!
There was an error while loading. Please reload this page.
[Bug] Enforce cpus-per-task for SlurmJobExecutor - #1002
Conversation
📝 WalkthroughWalkthroughThe PR broadens SLURM command generation to add ChangesSLURM cpus-per-task condition
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/executorlib/standalone/command.py`:
- Around line 156-157: Add a regression test that exercises the code path where
threads_per_core == 1 and asserts the generated SLURM/Sbatch command includes
the exact flag "--cpus-per-task=1"; specifically, call the same command-building
function or routine that produces command_prepend_lst (the code in
src/executorlib/standalone/command.py that checks threads_per_core and appends
"--cpus-per-task=") with threads_per_core=1 and assert the resulting command
list/string contains "--cpus-per-task=1" to prevent regressions (place this
alongside the existing tests that cover threads_per_core=2).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b9ba5929-6353-44c4-9020-c2f4fdb7e452
📒 Files selected for processing (1)
src/executorlib/standalone/command.py
| if threads_per_core >= 1: | ||
| command_prepend_lst += ["--cpus-per-task=" + str(threads_per_core)] |
There was a problem hiding this comment.
Add a regression test for threads_per_core == 1.
This behavior change is not locked by the shown test coverage (only threads_per_core=2 is asserted), so a dedicated assertion for --cpus-per-task=1 would prevent regressions on this exact condition.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/executorlib/standalone/command.py` around lines 156 - 157, Add a
regression test that exercises the code path where threads_per_core == 1 and
asserts the generated SLURM/Sbatch command includes the exact flag
"--cpus-per-task=1"; specifically, call the same command-building function or
routine that produces command_prepend_lst (the code in
src/executorlib/standalone/command.py that checks threads_per_core and appends
"--cpus-per-task=") with threads_per_core=1 and assert the resulting command
list/string contains "--cpus-per-task=1" to prevent regressions (place this
alongside the existing tests that cover threads_per_core=2).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #1002 +/- ##
=======================================
Coverage 94.19% 94.19% =======================================
Files 39 39 Lines 2103 2103 =======================================
Hits 1981 1981 Misses 122 122 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Uh oh!
There was an error while loading. Please reload this page.
Summary by CodeRabbit