Skip to content

Make dtest respect the '-n' flag to limit the number of threads#210

Merged
zzcgumn merged 4 commits into
dds-bridge:developfrom
tameware:dtest-threading
Jun 26, 2026
Merged

Make dtest respect the '-n' flag to limit the number of threads#210
zzcgumn merged 4 commits into
dds-bridge:developfrom
tameware:dtest-threading

Conversation

@tameware

Copy link
Copy Markdown
Collaborator

No description provided.

tameware and others added 2 commits June 26, 2026 12:44
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.

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.

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 through CalcAllTablesPBNN(..., maxThreads) and compute an effective thread cap from -n and the batch workload.
  • Update dtest and itest to call SetResources(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).

Comment thread library/tests/loop.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread library/tests/loop.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@tameware tameware requested a review from zzcgumn June 26, 2026 19:20
@tameware tameware marked this pull request as ready for review June 26, 2026 19:20

@zzcgumn zzcgumn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agree, let's keep these things consistent

@zzcgumn zzcgumn merged commit 2999c21 into dds-bridge:develop Jun 26, 2026
7 checks passed
@tameware tameware deleted the dtest-threading branch June 27, 2026 02:08
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