Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ac3c30c
Test code for parallel assembly
j-fu May 10, 2024
31501b2
Allow for parallel assembly via locking
j-fu May 10, 2024
b2c141e
t2
jotaraz Feb 20, 2024
751cf6c
add ExtendableSparseParallel
jotaraz Feb 20, 2024
b0953fe
add Mittal,Al-Kurdi ILU
jotaraz Feb 20, 2024
5df8735
implement ILU (sequential and parallel) based on Mittal and Al-Kurdi
jotaraz Feb 23, 2024
3ed83fa
ColEntry from struct to mutable struct
jotaraz Feb 23, 2024
f78ed1d
enable deeper partitioning / fixing some preparatory functions
jotaraz Feb 26, 2024
9e6dd1d
add parallel matrix vector product
jotaraz Mar 17, 2024
0cc56e8
remove old code
jotaraz Mar 17, 2024
0f282c6
added preparation for edgewise assembly
jotaraz Mar 24, 2024
d5b9bac
added comment
jotaraz May 10, 2024
d0b6c63
removed grid dependency of ESMP
jotaraz May 11, 2024
6d18295
minor change: no globalcounter ouutput in constructor anymore
jotaraz May 12, 2024
01cc1ee
remove grid dependency of ExtendableSparse.jl completely + minor rest…
jotaraz May 13, 2024
8d56f99
add comment on collnk
jotaraz May 14, 2024
1fa752d
some better explanation of parallel test tools
j-fu May 13, 2024
493bec2
reorganized: put developing stuff into Experimental
j-fu May 16, 2024
954819c
ExtendableSparseMatrixParallelDict & tests
j-fu May 18, 2024
96f015d
Parallelism with Dict based matrices
j-fu May 22, 2024
79432f3
AbstractExtendableSparseMatrix for "old" code.
j-fu May 22, 2024
94250d1
add Experimental tests to CI
j-fu May 23, 2024
e6887fc
add ExperimentalParallelLocking to tests
j-fu May 23, 2024
58fbb32
Generic extendable sparse matrix structs for parallel, scalar
j-fu May 26, 2024
db51b63
tests using generic extendable code
j-fu May 26, 2024
adf95be
Introduce AbstractSparseMatrixExtension
j-fu May 27, 2024
4fb318e
ci: new ci matrix, multithreading
j-fu May 27, 2024
99f9851
fix sparse!, replace Threads.@threads by tasks
j-fu May 27, 2024
a78d8ec
fix sparse! calls
j-fu May 27, 2024
f183d93
fix Base.: dispatch for 1.9
j-fu May 27, 2024
c3b78c9
working example with VoronoiFVM
j-fu May 28, 2024
dea60a4
Tests with partitioned grids.
j-fu Jun 17, 2024
d16e33d
parallelization + tests based on grid node partitioning
j-fu Jun 17, 2024
d796b78
move all experimental code to experimental subdir
j-fu Jun 18, 2024
6cd48cd
tweak tests
j-fu Jun 19, 2024
c6d9f09
untweak tests, use partitioning correction
j-fu Jun 23, 2024
7ff835c
Merge branch 'master' into jf-parallel2
j-fu Jun 23, 2024
dc216a3
update compat for ExtendableGrids
j-fu Jun 24, 2024
18bc37f
moving things away from experimental
j-fu Jun 24, 2024
8d7b216
Fix MT/ST stuff for VoronoiFVM (in single threaded mode)
j-fu Jul 1, 2024
4437971
additional methods for VoronoiFVM: nnznew
j-fu Jul 2, 2024
90dc3d7
Restructure tests
j-fu Jul 7, 2024
f0f0f2b
remove experimental code which has been moved to matrix
j-fu Jul 7, 2024
41d23cc
ExplicitImports
j-fu Jul 7, 2024
24f73ab
fix some docstrings, AMGCLWrap dependency
j-fu Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
style = "sciml"
style = "yas"
always_for_in = false
separate_kwargs_with_semicolon = true
format_markdown = true
import_to_using = false
pipe_to_function_call = false
short_to_long_function_def = false
always_use_return = false
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,26 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1.9' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
- 'nightly'
os:
- ubuntu-latest
- macos-latest
- windows-latest
- macos-latest # arm
- macOS-13 # intel
arch:
- x64
- aarch64
exclude:
- os: ubuntu-latest
arch: aarch64
- os: windows-latest
arch: aarch64
- os: macOS-13
arch: aarch64
- os: macos-latest
arch: x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
Expand All @@ -42,6 +53,8 @@ jobs:
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
JULIA_NUM_THREADS: 4
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
docs:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
QUARRY
docs/build
*~
Manifest.toml
Manifest*.toml
.repl_history
quarry

8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name = "ExtendableSparse"
uuid = "95c220a8-a1cf-11e9-0c77-dbfce5f500b3"
authors = ["Juergen Fuhrmann <juergen.fuhrmann@wias-berlin.de>"]
version = "1.4.1"
version = "1.5.0"

[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"
Metis = "2679e427-3c69-5b7f-982b-ece356f1e94b"
OhMyThreads = "67456a42-1dca-4109-a031-0a68de7e3ad5"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand All @@ -29,7 +31,7 @@ ExtendableSparseIncompleteLUExt = "IncompleteLU"
ExtendableSparsePardisoExt = "Pardiso"

[compat]
AMGCLWrap = "0.3.1,0.4"
AMGCLWrap = "0.4"
AlgebraicMultigrid = "0.4,0.5,0.6"
DocStringExtensions = "0.8, 0.9"
ILUZero = "0.2"
Expand All @@ -38,7 +40,7 @@ Pardiso = "0.5.1"
Requires = "1.1.3"
Sparspak = "0.3.6"
StaticArrays = "1.5.24"
julia = "1.6"
julia = "1.9"

[extras]
AMGCLWrap = "4f76b812-4ba5-496d-b042-d70715554288"
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function mkdocs()
makedocs(; sitename = "ExtendableSparse.jl",
modules = [ExtendableSparse],
doctest = false,
warnonly = true,
clean = false,
authors = "J. Fuhrmann",
repo = "https://github.com/j-fu/ExtendableSparse.jl",
Expand Down
11 changes: 11 additions & 0 deletions docs/src/internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ Pages = ["sparsematrixlnk.jl"]
Modules = [ExtendableSparse]
Pages = ["sparsematrixcsc.jl"]
```
## New API
Under development - aimed at multithreading
```@autodocs
Modules = [ExtendableSparse]
Pages = ["abstractsparsematrixextension.jl",
"abstractextendablesparsematrixcsc.jl",
"sparsematrixdilnkc.jl",
"genericextendablesparsematrixcsc.jl",
"genericmtextendablesparsematrixcsc.jl"]
```


## Misc methods

Expand Down
80 changes: 42 additions & 38 deletions src/ExtendableSparse.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
module ExtendableSparse
using SparseArrays,StaticArrays
using LinearAlgebra
using Sparspak
using ILUZero

if !isdefined(Base, :get_extension)
using Requires
end
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,
dropzeros!, findnz, nzrange, sparse, spzeros
using Sparspak: Sparspak, sparspaklu, sparspaklu!
using StaticArrays: StaticArrays, SMatrix, SVector
using SuiteSparse: SuiteSparse
import SparseArrays: AbstractSparseMatrixCSC, rowvals, getcolptr, nonzeros


# Define our own constant here in order to be able to
# test things at least a little bit..
Expand All @@ -17,58 +22,57 @@ if USE_GPL_LIBS
end


using DocStringExtensions

import SparseArrays: AbstractSparseMatrixCSC, rowvals, getcolptr, nonzeros

include("matrix/sparsematrixcsc.jl")
include("matrix/abstractsparsematrixextension.jl")
include("matrix/sparsematrixlnk.jl")
include("matrix/sparsematrixdilnkc.jl")
include("matrix/abstractextendablesparsematrixcsc.jl")
include("matrix/extendable.jl")
include("matrix/genericmtextendablesparsematrixcsc.jl")
include("matrix/genericextendablesparsematrixcsc.jl")

const ExtendableSparseMatrix=ExtendableSparseMatrixCSC
const MTExtendableSparseMatrixCSC{Tv,Ti}=GenericMTExtendableSparseMatrixCSC{SparseMatrixDILNKC{Tv,Ti},Tv,Ti}
MTExtendableSparseMatrixCSC(m,n,args...)=MTExtendableSparseMatrixCSC{Float64,Int64}(m,n,args...)

const STExtendableSparseMatrixCSC{Tv,Ti}=GenericExtendableSparseMatrixCSC{SparseMatrixDILNKC{Tv,Ti},Tv,Ti}
STExtendableSparseMatrixCSC(m,n,args...)=STExtendableSparseMatrixCSC{Float64,Int64}(m,n,args...)

export SparseMatrixLNK,
ExtendableSparseMatrix, flush!, nnz, updateindex!, rawupdateindex!, colptrs, sparse

export ExtendableSparseMatrixCSC, MTExtendableSparseMatrixCSC, STExtendableSparseMatrixCSC, GenericMTExtendableSparseMatrixCSC
export SparseMatrixLNK, ExtendableSparseMatrix,flush!, nnz, updateindex!, rawupdateindex!, colptrs, sparse, reset!, nnznew
export partitioning!

export eliminate_dirichlet, eliminate_dirichlet!, mark_dirichlet

include("factorizations/factorizations.jl")

include("experimental/Experimental.jl")

include("factorizations/simple_iteration.jl")
export simple, simple!

include("matrix/sprand.jl")
export sprand!, sprand_sdd!, fdrand, fdrand!, fdrand_coo, solverbenchmark

export rawupdateindex!, updateindex!




export JacobiPreconditioner,
ILU0Preconditioner,
ILUZeroPreconditioner,
PointBlockILUZeroPreconditioner,
ParallelJacobiPreconditioner,
ParallelILU0Preconditioner,
BlockPreconditioner,allow_views,
reorderlinsys
BlockPreconditioner,allow_views

export AbstractFactorization, LUFactorization, CholeskyFactorization, SparspakLU
export issolver
export factorize!, update!

include("factorizations/simple_iteration.jl")
export simple, simple!

include("matrix/sprand.jl")
export sprand!, sprand_sdd!, fdrand, fdrand!, fdrand_coo, solverbenchmark


@static if !isdefined(Base, :get_extension)
function __init__()
@require Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" begin
include("../ext/ExtendableSparsePardisoExt.jl")
end
@require IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895" begin
include("../ext/ExtendableSparseIncompleteLUExt.jl")
end
@require AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c" begin
include("../ext/ExtendableSparseAlgebraicMultigridExt.jl")
end
@require AMGCLWrap = "4f76b812-4ba5-496d-b042-d70715554288" begin
include("../ext/ExtendableSparseAMGCLWrapExt.jl")
end
end
end

"""
```
ILUTPreconditioner(;droptol=1.0e-3)
Expand Down
44 changes: 44 additions & 0 deletions src/experimental/Experimental.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module Experimental
using ExtendableSparse, SparseArrays
using LinearAlgebra
using SparseArrays: AbstractSparseMatrixCSC
import SparseArrays: nonzeros, getcolptr,nzrange
import ExtendableSparse: flush!, reset!, rawupdateindex!, findindex
using ExtendableSparse: ColEntry, AbstractPreconditioner, @makefrommatrix, phash
using ExtendableSparse: AbstractExtendableSparseMatrixCSC, AbstractSparseMatrixExtension
using DocStringExtensions
using Metis
using Base.Threads
using OhMyThreads: @tasks
import ExtendableSparse: factorize!, update!, partitioning!

include(joinpath(@__DIR__, "ExtendableSparseMatrixParallel", "ExtendableSparseParallel.jl"))

include(joinpath(@__DIR__, "ExtendableSparseMatrixParallel", "ilu_Al-Kurdi_Mittal.jl"))
#using .ILUAM
include(joinpath(@__DIR__, "ExtendableSparseMatrixParallel", "pilu_Al-Kurdi_Mittal.jl"))
#using .PILUAM

include(joinpath(@__DIR__, "ExtendableSparseMatrixParallel" ,"iluam.jl"))
include(joinpath(@__DIR__, "ExtendableSparseMatrixParallel", "piluam.jl"))

@eval begin
@makefrommatrix ILUAMPreconditioner
@makefrommatrix PILUAMPreconditioner
end

function factorize!(p::PILUAMPreconditioner, A::ExtendableSparseMatrixParallel)
p.A = A
update!(p)
p
end

export ExtendableSparseMatrixParallel, SuperSparseMatrixLNK
export addtoentry!, reset!, dummy_assembly!, preparatory_multi_ps_less_reverse, fr, addtoentry!, compare_matrices_light
export ILUAMPreconditioner, PILUAMPreconditioner
export reorderlinsys, nnz_noflush



end

Loading