Skip to content

Commit 5386b39

Browse files
authored
Set max_threads_init default to max_threads (#13)
1 parent 0251a0a commit 5386b39

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/svsbench/build.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ def _read_args(argv: list[str] | None = None) -> argparse.Namespace:
4545
)
4646
parser.add_argument(
4747
"--max_threads_init",
48-
help="Maximum number of threads for the first operation",
49-
default=max(len(os.sched_getaffinity(0)) - 1, 1),
48+
help="Maximum number of threads for building the initial graph",
5049
type=int,
5150
)
5251
parser.add_argument(
@@ -157,7 +156,7 @@ def build_dynamic(
157156
max_candidate_pool_size: int = 750,
158157
alpha: float | None = None,
159158
max_threads: int = 1,
160-
max_threads_init: int = 1,
159+
max_threads_init: int | None = None,
161160
batch_size: int = 10000,
162161
num_vectors_delete: int = 0,
163162
num_vectors_init: int | None = None,
@@ -202,6 +201,8 @@ def build_dynamic(
202201
num_vectors_init = batch_size
203202
else:
204203
num_vectors_init = int(num_vectors * proportion_vectors_init)
204+
if max_threads_init is None:
205+
max_threads_init = max_threads
205206
if not max_threads_ignore_batch:
206207
max_threads = min(max_threads, batch_size)
207208
max_threads_init = min(max_threads_init, num_vectors_init)

0 commit comments

Comments
 (0)