Skip to content

Commit

Permalink
fixes a bug: parallel append! and index! failed on small datasets, n …
Browse files Browse the repository at this point in the history
…< parallel_minimum_first_block
  • Loading branch information
sadit committed Mar 11, 2022
1 parent 39179aa commit d064323
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SimilaritySearch"
uuid = "053f045d-5466-53fd-b400-a066f88fe02a"
authors = ["Eric S. Tellez <donsadit@gmail.com>"]
version = "0.8.10"
version = "0.8.11"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand All @@ -20,4 +20,4 @@ Intersections = "0.2.5"
Parameters = "0.12"
SearchModels = "0.3"
StatsBase = "0.30.0, 0.32.0, 0.33"
julia = "1.5"
julia = "1.6"
4 changes: 4 additions & 0 deletions src/graph/graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ function Base.append!(
parallel_block == 1 && return _sequential_append_loop!(index, callbacks, pools)

m = 0

parallel_minimum_first_block = min(parallel_minimum_first_block, n)
while length(index) < parallel_minimum_first_block
m += 1
push_item!(index, db[m], false, callbacks, pools)
Expand Down Expand Up @@ -216,6 +218,8 @@ function index!(
m = 0
db = index.db
n = length(db)

parallel_minimum_first_block = min(parallel_minimum_first_block, n)
while length(index) < parallel_minimum_first_block
m += 1
push_item!(index, db[m], false, callbacks, pools)
Expand Down

2 comments on commit d064323

@sadit
Copy link
Owner Author

@sadit sadit commented on d064323 Mar 11, 2022

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/56428

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.11 -m "<description of version>" d0643237bb73d4f4a330cb47c4297145273724b2
git push origin v0.8.11

Please sign in to comment.