Skip to content

Commit

Permalink
Remove OhMyThreads dependency
Browse files Browse the repository at this point in the history
As long this would just amount to writing @tasks instead of @threads
its seems it provides no difference. So we decrease the "attack surface"

Nevertheless that Package is a great resource of know-how...
  • Loading branch information
j-fu committed Jul 22, 2024
1 parent 33ced7b commit a327c2d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name = "ExtendableSparse"
uuid = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
authors = ["Juergen Fuhrmann <[email protected]>"]
version = "1.5.0"
version = "1.5.1"

[deps]
AMGCLWrap = "4f76b812-4ba5-496d-b042-d70715554288"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
ILUZero = "88f59080-6952-5380-9ea5-54057fb9a43f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
OhMyThreads = "67456a42-1dca-4109-a031-0a68de7e3ad5"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Sparspak = "e56a9233-b9d6-4f03-8d0f-1825330902ac"
Expand All @@ -34,7 +33,6 @@ AlgebraicMultigrid = "0.4,0.5,0.6"
DocStringExtensions = "0.8, 0.9"
ILUZero = "0.2"
IncompleteLU = "^0.2.1"
OhMyThreads = "0.5.3"
Pardiso = "0.5.1"
Sparspak = "0.3.6"
StaticArrays = "1.5.24"
Expand Down
1 change: 0 additions & 1 deletion src/ExtendableSparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module ExtendableSparse

using DocStringExtensions: DocStringExtensions, SIGNATURES, TYPEDEF,TYPEDFIELDS
using ILUZero: ILUZero, ldiv!, nnz
using OhMyThreads: @tasks
using LinearAlgebra: LinearAlgebra, Diagonal, Hermitian, Symmetric, Tridiagonal,
cholesky, cholesky!, convert, lu!, mul!, norm, transpose
using SparseArrays: SparseArrays, AbstractSparseMatrix, SparseMatrixCSC,
Expand Down
1 change: 0 additions & 1 deletion src/experimental/Experimental.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ using ExtendableSparse: AbstractExtendableSparseMatrixCSC, AbstractSparseMatrix
using DocStringExtensions
using Metis
using Base.Threads
using OhMyThreads: @tasks
import ExtendableSparse: factorize!, update!, partitioning!

include(joinpath(@__DIR__, "ExtendableSparseMatrixParallel", "ExtendableSparseParallel.jl"))
Expand Down
13 changes: 6 additions & 7 deletions src/factorizations/blockpreconditioner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function update!(precon::BlockPreconditioner)

np=length(precon.partitioning)
precon.facts=Vector{Any}(undef,np)
@tasks for ipart=1:np
Threads.@threads for ipart=1:np
factorization=deepcopy(precon.factorization)
AP=precon.A[precon.partitioning[ipart],precon.partitioning[ipart]]
FP=factorization(AP)
Expand All @@ -66,11 +66,11 @@ function LinearAlgebra.ldiv!(p::BlockPreconditioner,v)
np=length(partitioning)

if allow_views(p.factorization)
@tasks for ipart=1:np
Threads.@threads for ipart=1:np
ldiv!(facts[ipart],view(v,partitioning[ipart]))
end
else
@tasks for ipart=1:np
Threads.@threads for ipart=1:np
vv=v[partitioning[ipart]]
ldiv!(facts[ipart],vv)
view(v,partitioning[ipart]).=vv
Expand All @@ -83,13 +83,12 @@ function LinearAlgebra.ldiv!(u,p::BlockPreconditioner,v)
partitioning=p.partitioning
facts=p.facts
np=length(partitioning)

if allow_views(p.factorization)
@tasks for ipart=1:np
if allow_views(p.factorization)
Threads.@threads for ipart=1:np
ldiv!(view(u,partitioning[ipart]),facts[ipart],view(v,partitioning[ipart]))
end
else
@tasks for ipart=1:np
Threads.@threads for ipart=1:np
uu=u[partitioning[ipart]]
ldiv!(uu,facts[ipart],v[partitioning[ipart]])
view(u,partitioning[ipart]).=uu
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/genericmtextendablesparsematrixcsc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function LinearAlgebra.mul!(r, ext::GenericMTExtendableSparseMatrixCSC, x)
r.=zero(eltype(ext))
m,n=size(A)
for icol=1:length(colparts)-1
@tasks for ip in colparts[icol]:colparts[icol+1]-1
Threads.@threads for ip in colparts[icol]:colparts[icol+1]-1
@inbounds for inode in partnodes[ip]:partnodes[ip+1]-1
@inbounds for i in nzrange(A,inode)
r[rows[i]]+=vals[i]*x[inode]
Expand Down

2 comments on commit a327c2d

@j-fu
Copy link
Member Author

@j-fu j-fu commented on a327c2d Jul 22, 2024

Choose a reason for hiding this comment

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

@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/111556

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 v1.5.1 -m "<description of version>" a327c2d96409c4690e2d83a520366f091800e5c1
git push origin v1.5.1

Please sign in to comment.