Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6d17cd2

Browse filesBrowse files
authored
MAINT Convert OpenMP scheduling to 'static' in pairwise distances radius neighborhood (#22829)
1 parent c61086b commit 6d17cd2
Copy full SHA for 6d17cd2

File tree

Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed

‎sklearn/metrics/_pairwise_distances_reduction.pyx

Copy file name to clipboardExpand all lines: sklearn/metrics/_pairwise_distances_reduction.pyx
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,8 +1511,7 @@ cdef class PairwiseDistancesRadiusNeighborhood(PairwiseDistancesReduction):
15111511
# This is done in parallel sample-wise (no need for locks)
15121512
# using dynamic scheduling because we might not have
15131513
# the same number of neighbors for each query vector.
1514-
# TODO: compare 'dynamic' vs 'static' vs 'guided'
1515-
for idx in prange(self.n_samples_X, schedule='dynamic'):
1514+
for idx in prange(self.n_samples_X, schedule='static'):
15161515
self._merge_vectors(idx, self.chunks_n_threads)
15171516

15181517
# The content of the vector have been std::moved.
@@ -1536,7 +1535,7 @@ cdef class PairwiseDistancesRadiusNeighborhood(PairwiseDistancesReduction):
15361535
cdef:
15371536
ITYPE_t i, j
15381537

1539-
for i in prange(self.n_samples_X, nogil=True, schedule='dynamic',
1538+
for i in prange(self.n_samples_X, nogil=True, schedule='static',
15401539
num_threads=self.effective_n_threads):
15411540
for j in range(deref(self.neigh_indices)[i].size()):
15421541
deref(self.neigh_distances)[i][j] = (

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.