Skip to content

Commit c9bce69

Browse files
authored
Merge pull request #116 from JordiManyer/psparse-with-local-indices
Using LocalIndices with psparse! constructors
2 parents 74e04a3 + 160c4a9 commit c9bce69

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Added an MPI ibarrier-based (supposedly scalable) algorithm to find rcv neighbours in a sparse all-to-all communication graph given the snd neighbors. We left the previous non-scalable algorithm as default (based on gather-scatter) until we have experimental evidence on the relative performance and scalability of the former with respect to the latter and for which core ranges.
13+
- Added a new kwarg `discover_cols=true` to the `psparse!` constructor, which allows the user to skip column index discovery.
1314

1415
### Fixed
1516

src/p_sparse_matrix.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -471,23 +471,25 @@ function LinearAlgebra.mul!(c::PVector,a::PSparseMatrix,b::PVector,α::Number,β
471471
end
472472

473473
"""
474-
psparse!([f,]I,J,V,row_partition,col_partition;discover_rows=true) -> Task
474+
psparse!([f,]I,J,V,row_partition,col_partition;discover_rows=true,discover_cols=true) -> Task
475475
476476
Crate an instance of [`PSparseMatrix`](@ref) by setting arbitrary entries
477477
from each of the underlying parts. It returns a task that produces the
478478
instance of [`PSparseMatrix`](@ref) allowing latency hiding while performing
479479
the communications needed in its setup.
480480
"""
481-
function psparse!(f,I,J,V,row_partition,col_partition;discover_rows=true)
481+
function psparse!(f,I,J,V,row_partition,col_partition;discover_rows=true,discover_cols=true)
482482
if discover_rows
483483
I_owner = find_owner(row_partition,I)
484484
row_partition = map(union_ghost,row_partition,I,I_owner)
485485
end
486486
t = assemble_coo!(I,J,V,row_partition)
487487
@async begin
488488
wait(t)
489-
J_owner = find_owner(col_partition,J)
490-
col_partition = map(union_ghost,col_partition,J,J_owner)
489+
if discover_cols
490+
J_owner = find_owner(col_partition,J)
491+
col_partition = map(union_ghost,col_partition,J,J_owner)
492+
end
491493
map(to_local!,I,row_partition)
492494
map(to_local!,J,col_partition)
493495
matrix_partition = map(f,I,J,V,row_partition,col_partition)

0 commit comments

Comments
 (0)