Skip to content

Commit 997ac6e

Browse files
committed
Renamed split_values -> split_format
1 parent 7ca291d commit 997ac6e

File tree

3 files changed

+24
-32
lines changed

3 files changed

+24
-32
lines changed

src/PartitionedArrays.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ export PSparseMatrix
130130
export old_psparse
131131
export psparse
132132
export psparse!
133-
export split_values
134-
export split_values!
133+
export split_format
134+
export split_format!
135135
export old_psparse!
136136
export own_ghost_values
137137
export ghost_own_values

src/p_sparse_matrix.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ function LinearAlgebra.fillstored!(a::AbstractSplitMatrix,v)
697697
a
698698
end
699699

700-
function split_locally(A,rows,cols)
700+
function split_format_locally(A,rows,cols)
701701
n_own_rows = own_length(rows)
702702
n_own_cols = own_length(cols)
703703
n_ghost_rows = ghost_length(rows)
@@ -775,7 +775,7 @@ function split_locally(A,rows,cols)
775775
B, cache
776776
end
777777

778-
function split_locally!(B::AbstractSplitMatrix,A,rows,cols,cache)
778+
function split_format_locally!(B::AbstractSplitMatrix,A,rows,cols,cache)
779779
(c1,c2,c3,c4,own_own_V,own_ghost_V,ghost_own_V,ghost_ghost_V) = cache
780780
n_own_rows = own_length(rows)
781781
n_own_cols = own_length(cols)
@@ -971,10 +971,10 @@ end
971971
val_parameter(a) = a
972972
val_parameter(::Val{a}) where a = a
973973

974-
function split_values(A::PSparseMatrix;reuse=Val(false))
974+
function split_format(A::PSparseMatrix;reuse=Val(false))
975975
rows = partition(axes(A,1))
976976
cols = partition(axes(A,2))
977-
values, cache = map(split_locally,partition(A),rows,cols) |> tuple_of_arrays
977+
values, cache = map(split_format_locally,partition(A),rows,cols) |> tuple_of_arrays
978978
B = PSparseMatrix(values,rows,cols,A.assembled)
979979
if val_parameter(reuse) == false
980980
B
@@ -983,10 +983,10 @@ function split_values(A::PSparseMatrix;reuse=Val(false))
983983
end
984984
end
985985

986-
function split_values!(B,A::PSparseMatrix,cache)
986+
function split_format!(B,A::PSparseMatrix,cache)
987987
rows = partition(axes(A,1))
988988
cols = partition(axes(A,2))
989-
map(split_locally!,partition(B),partition(A),rows,cols,cache)
989+
map(split_format_locally!,partition(B),partition(A),rows,cols,cache)
990990
B
991991
end
992992

@@ -1019,7 +1019,7 @@ instance of [`PSparseMatrix`](@ref) allowing latency hiding while performing
10191019
the communications needed in its setup.
10201020
"""
10211021
function psparse(f,I,J,V,rows,cols;
1022-
split=true,
1022+
split_format=true,
10231023
assembled=false,
10241024
assemble=true,
10251025
discover_rows=true,
@@ -1033,7 +1033,7 @@ function psparse(f,I,J,V,rows,cols;
10331033
# TODO for some particular cases
10341034
# this function allocates more
10351035
# intermediate results than needed
1036-
# One can e.g. merge the split and assemble steps
1036+
# One can e.g. merge the split_format and assemble steps
10371037
# Even the matrix compression step could be
10381038
# merged with the assembly step
10391039

@@ -1072,8 +1072,8 @@ function psparse(f,I,J,V,rows,cols;
10721072
map(map_local_to_global!,J,cols_sa)
10731073
end
10741074
A = PSparseMatrix(values_sa,rows_sa,cols_sa,assembled)
1075-
if split
1076-
B,cacheB = split_values(A;reuse=true)
1075+
if split_format
1076+
B,cacheB = PartitionedArrays.split_format(A;reuse=true)
10771077
else
10781078
B,cacheB = A,nothing
10791079
end
@@ -1090,7 +1090,7 @@ function psparse(f,I,J,V,rows,cols;
10901090
else
10911091
return @async begin
10921092
C, cacheC = fetch(t)
1093-
cache = (A,B,K,cacheB,cacheC,split,assembled)
1093+
cache = (A,B,K,cacheB,cacheC,split_format,assembled)
10941094
(C, cache)
10951095
end
10961096
end
@@ -1100,13 +1100,13 @@ end
11001100
psparse!(C::PSparseMatrix,V,cache)
11011101
"""
11021102
function psparse!(C,V,cache)
1103-
(A,B,K,cacheB,cacheC,split,assembled) = cache
1103+
(A,B,K,cacheB,cacheC,split_format,assembled) = cache
11041104
rows_sa = partition(axes(A,1))
11051105
cols_sa = partition(axes(A,2))
11061106
values_sa = partition(A)
11071107
map(setcoofast!,values_sa,V,K)
1108-
if split
1109-
split_values!(B,A,cacheB)
1108+
if split_format
1109+
split_format!(B,A,cacheB)
11101110
end
11111111
if !assembled && C.assembled
11121112
t = PartitionedArrays.assemble!(C,B,cacheC)

test/p_sparse_matrix_tests.jl

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,21 @@ function p_sparse_matrix_tests(distribute)
141141
end
142142
end |> tuple_of_arrays
143143

144-
A = psparse(I,J,V,row_partition,col_partition,split=false,assemble=false) |> fetch
145-
B = split_values(A)
146-
B, cache = split_values(A,reuse=true)
147-
split_values!(B,A,cache)
144+
A = psparse(I,J,V,row_partition,col_partition,split_format=false,assemble=false) |> fetch
145+
B = split_format(A)
146+
B, cache = split_format(A,reuse=true)
147+
split_format!(B,A,cache)
148148
C = assemble(B) |> fetch
149149
C,cache = assemble(B,reuse=true) |> fetch
150150
assemble!(C,B,cache) |> wait
151151
display(C)
152152

153-
A = psparse(I,J,V,row_partition,col_partition,split=true,assemble=false) |> fetch
154-
A = psparse(I,J,V,row_partition,col_partition,split=true,assemble=true) |> fetch
153+
A = psparse(I,J,V,row_partition,col_partition,split_format=true,assemble=false) |> fetch
154+
A = psparse(I,J,V,row_partition,col_partition,split_format=true,assemble=true) |> fetch
155155
A = psparse(I,J,V,row_partition,col_partition) |> fetch
156156
display(A)
157-
# TODO Assembly in non-split format not yet implemented
158-
#A = psparse(I,J,V,row_partition,col_partition,split=false,assemble=true) |> fetch
157+
# TODO Assembly in non-split_format format not yet implemented
158+
#A = psparse(I,J,V,row_partition,col_partition,split_format=false,assemble=true) |> fetch
159159

160160
A,cache = psparse(I,J,V,row_partition,col_partition,reuse=true) |> fetch
161161
psparse!(A,V,cache) |> wait
@@ -304,13 +304,5 @@ function p_sparse_matrix_tests(distribute)
304304
#cr = Ar\br
305305
#renumber!(c,cr)
306306

307-
# TODO
308-
# 3. Cleanup and documentation
309-
# better names for precompute_nzindex, setcoofast
310-
# better name for split_values, split_values!
311-
# how to avoind conflicts with existing functions
312-
# in particular: delete val_parameter
313-
# renumber
314-
315307
end
316308

0 commit comments

Comments
 (0)