Make dtest respect the '-n' flag to limit the number of threads#210
Merged
Conversation
Pass dtest_effective_threads through to calc batches so calc threading matches solve and responds to the -n flag. Co-authored-by: Cursor <cursoragent@cursor.com>
SetResources ignores maxThreads; threading is handled via dtest_effective_threads and the *N batch APIs. Passing -n only triggered a misleading library warning. itest.cpp will be removed in a future PR.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the test drivers to ensure the -n CLI flag (requested worker threads) is respected when running table-calculation batches, aligning dtest’s threading behavior across solve and calc paths.
Changes:
- In
loop_calc, route table calculations throughCalcAllTablesPBNN(..., maxThreads)and compute an effective thread cap from-nand the batch workload. - Update
dtestanditestto callSetResources(memory, 0)so legacy thread-resource configuration doesn’t conflict with per-call thread caps (and avoids warnings for>1).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| library/tests/loop.cpp | Uses CalcAllTablesPBNN with an explicit thread cap derived from -n and the batch workload. |
| library/tests/itest.cpp | Stops passing options.num_threads_ into legacy SetResources (now 0). |
| library/tests/dtest.cpp | Stops passing options.num_threads_ into legacy SetResources (now 0). |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
zzcgumn
approved these changes
Jun 26, 2026
zzcgumn
left a comment
Collaborator
There was a problem hiding this comment.
Agree, let's keep these things consistent
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.
No description provided.