Skip to content

Fixed performance issues in consistent/assemble, new and improved distributed sparse matrix multiplication algorithms. #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
fd26e92
changes to consistent and assemble for performance
jop611 Aug 9, 2024
b36653e
added relevant functions to export
jop611 Aug 9, 2024
29fcd0a
minor optimization to consistent, including reduced cache size
jop611 Aug 14, 2024
a4e1960
movig some functions back to inner scope
jop611 Aug 15, 2024
7bdb365
fix in consistent_impl
jop611 Aug 15, 2024
cc8a11d
fix in consistent_impl
jop611 Aug 15, 2024
851b3b1
fix in assemble_impl
jop611 Aug 15, 2024
cb2d5ef
fix in consistent_impl
jop611 Aug 15, 2024
b40dcde
minor changes+some cleanup
jop611 Aug 16, 2024
315999c
fixed leftover debug setting
jop611 Aug 16, 2024
ae538ba
Merge branch 'fverdugo:master' into master
jop611 Aug 16, 2024
395fa61
fixed bug in updated psaprse_consistent_impl!
jop611 Aug 16, 2024
c04ce81
reset to earlier state
jop611 Sep 5, 2024
a458fcc
fixed mistake in PSparseMatrix documentation (fieldnames/types), adde…
jop611 Sep 9, 2024
69f6895
Merge branch 'fverdugo:master' into master
jop611 Oct 21, 2024
0d4c06f
added versions of sparse_diag_matrix with custom matrix type option, …
jop611 Oct 21, 2024
a6e87b5
Merge branch 'master' of https://github.com/jop611/PartitionedArrays.…
jop611 Oct 21, 2024
47dea15
?
jop611 Oct 21, 2024
6079cf7
added some function with spare matrix construct function passed
jop611 Oct 21, 2024
82c17a9
fixed problem related to previous commit
jop611 Oct 21, 2024
5afff2e
fixed bug in expand_sparse_matrix functions
jop611 Oct 21, 2024
cb3d40a
fixed another issue with expand_sparse_matrix_columns
jop611 Oct 21, 2024
da64ff0
helper function for thesis contributions added
jop611 Oct 22, 2024
2f2e927
removed copy function for SparseCSR, as it is implemented by SparseMa…
jop611 Oct 22, 2024
e4e7035
Merge branch 'master' into master
jop611 Jan 24, 2025
cabad59
Added new distributed SpMM, SpMtM, SPMMM and SpMtMM algorithms with l…
jop611 Jan 24, 2025
33a36ad
fixed tests, add missing symbolic_halfperm methods.
jop611 Jan 27, 2025
a1b0f8f
uncommented a test line.
jop611 Jan 27, 2025
c29b7d3
Added spmtmm mpi driver to tests
jop611 Jan 28, 2025
18b564e
uncommented old code for PartitionedSOlvers tests (rap(...) and rap!(…
jop611 Jan 28, 2025
cddd0ad
changed RAP function names to rap for consistency
jop611 Jan 28, 2025
3a03304
changed RAP function names to rap for consistency
jop611 Jan 28, 2025
7d37364
Simplified dispatch, included automatic type promotion when required.
jop611 Jan 29, 2025
1e48b64
fixed exported function name (rap vs RAP).
jop611 Jan 29, 2025
33840d8
workaround for absence of 'reuse' kwargs in local sparse matrix multi…
jop611 Jan 29, 2025
1816fd7
fixed type piracy
jop611 Jan 29, 2025
1794482
fixed oversight in sarse matrix expansion in consistent
jop611 Jan 30, 2025
2378df5
fixes to expand_sparse_matrix and inclusion of general case.
jop611 Jan 31, 2025
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
25 changes: 25 additions & 0 deletions src/PartitionedArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using BlockArrays

export length_to_ptrs!
export rewind_ptrs!
export jagged_range
export jagged_array
export GenericJaggedArray
export JaggedArray
Expand All @@ -24,6 +25,12 @@ export compresscoo
export indextype
export sparse_matrix
export sparse_matrix!
export index_array
export pointer_array
export halfperm
export halfperm!
export symbolic_halfperm
export symbolic_halfperm!
include("sparse_utils.jl")

export linear_indices
Expand Down Expand Up @@ -169,9 +176,17 @@ export spmv!
export spmtv!
export spmm
export spmm!
export spmmm
export spmmm!
export spmtm
export spmtm!
export spmtmm
export spmtmm!
export centralize
export explicit_transpose
export explicit_transpose!
export add
export add!
include("p_sparse_matrix.jl")

export BRange
Expand All @@ -193,6 +208,16 @@ export node_coordinates_unit_cube
export nullspace_linear_elasticity
export nullspace_linear_elasticity!
export near_nullspace_linear_elasticity
export prolongator
include("gallery.jl")

export add
export subtract
export mul
export matmul
export matmul!
export rap
export rap!
include("sequential_implementations.jl")

end # module
3 changes: 0 additions & 3 deletions src/gallery.jl
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,3 @@ function nullspace_linear_elasticity!(B,x)
end
B
end



9 changes: 9 additions & 0 deletions src/jagged_array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ function JaggedArray{T,Ti}(a::AbstractArray{<:AbstractArray}) where {T,Ti}
JaggedArray(data,ptrs)
end

# New
function jagged_range(a::Union{JaggedArray,GenericJaggedArray},i::Integer)
u = one(eltype(a.ptrs))
pini = a.ptrs[i]
pend = a.ptrs[i+1]-u
pini:pend
end

###########

Base.size(a::Union{JaggedArray,GenericJaggedArray}) = (length(a.ptrs)-1,)
function Base.getindex(a::Union{JaggedArray,GenericJaggedArray},i::Int)
Expand Down
4 changes: 2 additions & 2 deletions src/p_range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ end
"""
neigs_snd, neigs_rcv = assembly_neighbors(index_partition;kwargs...)

Return the ids of the neighbor parts from we send and receive data respectively
Return the ids of the neighbor parts from which we send and receive data respectively
in the assembly of distributed vectors defined on the index
partition `index_partition`.
partition `index_partition`. `kwargs` are delegated to [`ExchangeGraph`](@ref)
Expand Down Expand Up @@ -470,7 +470,7 @@ end

function assembly_local_indices(indices,neighbors_snd,neighbors_rcv)
cache = map(assembly_cache,indices)
mask = map(cache) do mycache
mask = map(cache) do mycache
isassigned(mycache.local_indices_snd) && isassigned(mycache.local_indices_rcv)
end
if ! getany(mask)
Expand Down
Loading