@@ -1528,12 +1528,11 @@ end
1528
1528
# New assemble
1529
1529
# ###################
1530
1530
1531
- function psparse_assemble_impl (
1532
- A,
1533
- :: Type{T} ,
1534
- rows;
1535
- reuse= Val (false ),
1536
- assembly_neighbors_options_cols= (;)) where T<: AbstractSplitMatrix
1531
+ function psparse_assemble_impl (A:: PSparseMatrix{V,B,C,D,Tv} where {V,B,C,D},
1532
+ :: Type{T} ,
1533
+ rows;
1534
+ reuse= Val (false ),
1535
+ assembly_neighbors_options_cols= (;)) where {T<: AbstractSplitMatrix , Tv}
1537
1536
1538
1537
function setup_cache_snd (A,parts_snd,rows_sa,cols_sa)
1539
1538
A_ghost_own = A. blocks. ghost_own
@@ -1554,7 +1553,6 @@ function psparse_assemble_impl(
1554
1553
ptrs[owner_to_p[owner]+ 1 ] += 1
1555
1554
end
1556
1555
length_to_ptrs! (ptrs)
1557
- Tv = eltype (A_ghost_own)
1558
1556
ndata = ptrs[end ]- 1
1559
1557
I_snd_data = zeros (Int,ndata)
1560
1558
J_snd_data = zeros (Int,ndata)
@@ -1642,7 +1640,6 @@ function psparse_assemble_impl(
1642
1640
n_ghost_rows = ghost_length (rows_fa)
1643
1641
n_ghost_cols = ghost_length (cols_fa)
1644
1642
Ti = indextype (A. blocks. own_own)
1645
- Tv = eltype (A. blocks. own_own)
1646
1643
own_own = compresscoo (TA,own_own_triplet... ,n_own_rows,n_own_cols)
1647
1644
own_ghost = compresscoo (TA,own_ghost_triplet... ,n_own_rows,n_ghost_cols)
1648
1645
ghost_own = compresscoo (TA,Ti[],Ti[],Tv[],n_ghost_rows,n_own_cols)
@@ -1652,12 +1649,12 @@ function psparse_assemble_impl(
1652
1649
nnz_own_own = nnz (own_own)
1653
1650
k_own_sa = precompute_nzindex (own_own,own_own_triplet[1 : 2 ]. .. )
1654
1651
k_ghost_sa = precompute_nzindex (own_ghost,own_ghost_triplet[1 : 2 ]. .. )
1655
- for p in 1 : length (I_rcv_own)
1652
+ for p in eachindex (I_rcv_own)
1656
1653
i = I_rcv_own[p]
1657
1654
j = J_rcv_own[p]
1658
1655
k_rcv_own[p] = nzindex (own_own,i,j)
1659
1656
end
1660
- for p in 1 : length (I_rcv_ghost)
1657
+ for p in eachindex (I_rcv_ghost)
1661
1658
i = I_rcv_ghost[p]
1662
1659
j = J_rcv_ghost[p]
1663
1660
k_rcv_ghost[p] = nzindex (own_ghost,i,j) + nnz_own_own
@@ -1687,7 +1684,7 @@ function psparse_assemble_impl(
1687
1684
t_I = exchange (I_snd,graph)
1688
1685
t_J = exchange (J_snd,graph)
1689
1686
t_V = exchange (V_snd,graph)
1690
- @fake_async begin
1687
+ @sync begin
1691
1688
I_rcv = fetch (t_I)
1692
1689
J_rcv = fetch (t_J)
1693
1690
V_rcv = fetch (t_V)
@@ -1794,14 +1791,13 @@ end
1794
1791
1795
1792
# New consistent
1796
1793
# ###################
1797
- function psparse_consistent_impl (
1798
- A,
1799
- :: Type{T} ,
1800
- rows_co;
1801
- reuse= Val (false )) where T<: AbstractSplitMatrix
1794
+ function psparse_consistent_impl (A:: PSparseMatrix{V,B,C,D,Tv} where {V,B,C,D},
1795
+ :: Type{T} ,
1796
+ rows_co;
1797
+ reuse= Val (false )) where {T<: AbstractSplitMatrix , Tv}
1802
1798
1803
1799
function consistent_setup_snd (A,parts_snd,lids_snd,rows_co,cols_fa)
1804
- own_to_local_row:: UnitRange{Int32} = own_to_local (rows_co)
1800
+ own_to_local_row = own_to_local (rows_co)
1805
1801
own_to_global_row = own_to_global (rows_co)
1806
1802
own_to_global_col = own_to_global (cols_fa)
1807
1803
ghost_to_global_col = ghost_to_global (cols_fa)
@@ -1829,7 +1825,6 @@ function psparse_consistent_impl(
1829
1825
li_to_ps = JaggedArray (li_to_ps_data,li_to_ps_ptrs)
1830
1826
ptrs = zeros (Int32,length (parts_snd)+ 1 )
1831
1827
for (i,j,v) in nziterator (A. blocks. own_own)
1832
- # @show(typeof(own_to_local_row))
1833
1828
li = own_to_local_row[i]
1834
1829
for li_ptr in jagged_range (li_to_ps,li)
1835
1830
p = li_to_ps. data[li_ptr]
@@ -1846,7 +1841,6 @@ function psparse_consistent_impl(
1846
1841
end
1847
1842
length_to_ptrs! (ptrs)
1848
1843
ndata = ptrs[end ]- 1
1849
- Tv = eltype (A)
1850
1844
I_snd = JaggedArray (zeros (Int,ndata),ptrs)
1851
1845
J_snd = JaggedArray (zeros (Int,ndata),ptrs)
1852
1846
V_snd = JaggedArray (zeros (Tv,ndata),ptrs)
@@ -1892,7 +1886,7 @@ function psparse_consistent_impl(
1892
1886
J_rcv_data = cache_rcv. J_rcv. data
1893
1887
V_rcv_data = cache_rcv. V_rcv. data
1894
1888
global_to_own_col = global_to_own (cols_co)
1895
- global_to_ghost_col = global_to_ghost (cols_co)
1889
+ # global_to_ghost_col = global_to_ghost(cols_co)
1896
1890
is_own_condition = k -> global_to_own_col[k]!= 0
1897
1891
is_own = is_own_condition .(J_rcv_data)
1898
1892
I_rcv_own = I_rcv_data[is_own]
@@ -1937,7 +1931,6 @@ function psparse_consistent_impl(
1937
1931
rows_co;
1938
1932
reuse= Val (false )) where T<: AbstractSplitMatrix
1939
1933
@assert matching_own_indices (axes (A,1 ),PRange (rows_co))
1940
- rows_fa = partition (axes (A,1 ))
1941
1934
cols_fa = partition (axes (A,2 ))
1942
1935
# snd and rcv are swapped on purpose
1943
1936
parts_rcv,parts_snd = assembly_neighbors (rows_co)
@@ -1950,7 +1943,7 @@ function psparse_consistent_impl(
1950
1943
t_I = exchange (I_snd,graph)
1951
1944
t_J = exchange (J_snd,graph)
1952
1945
t_V = exchange (V_snd,graph)
1953
- @fake_async begin
1946
+ @sync begin
1954
1947
I_rcv = fetch (t_I)
1955
1948
J_rcv = fetch (t_J)
1956
1949
V_rcv = fetch (t_V)
@@ -1967,11 +1960,8 @@ function psparse_consistent_impl(
1967
1960
end
1968
1961
end
1969
1962
end
1970
-
1971
1963
_psparse_consistent_impl (A,T,rows_co;reuse)
1972
1964
end
1973
-
1974
-
1975
1965
# End new consistent
1976
1966
# ###################
1977
1967
0 commit comments