@@ -81,23 +81,6 @@ function petsc_coo(petsc_comm,I,J,V,rows,cols)
81
81
end
82
82
end
83
83
84
- function generate_coo (args... )
85
- A = PartitionedArrays. laplace_matrix (args... )
86
- row_partition = partition (axes (A,1 ))
87
- col_partition = partition (axes (A,2 ))
88
- (I,J,V) = map (partition (A),row_partition,col_partition) do myA,rows,cols
89
- Id,Jd,Vd = findnz (myA. blocks. own_own)
90
- Io,Jo,Vo = findnz (myA. blocks. own_ghost)
91
- myI = vcat (map_own_to_global! (Id,rows),map_own_to_global! (Io,rows))
92
- myJ = vcat (map_own_to_global! (Jd,cols),map_ghost_to_global! (Jo,cols))
93
- myV = vcat (Vd,Vo)
94
- Ti = PetscCall. PetscInt
95
- Tv = PetscCall. PetscScalar
96
- (convert (Vector{Ti},myI),convert (Vector{Ti},myJ),convert (Vector{Tv},myV))
97
- end |> tuple_of_arrays
98
- I,J,V,row_partition,col_partition
99
- end
100
-
101
84
function main (distribute,params)
102
85
nodes_per_dir = params. nodes_per_dir
103
86
parts_per_dir = params. parts_per_dir
@@ -121,10 +104,9 @@ function main(distribute,params)
121
104
@test norm (c)/ norm (b1) < tol
122
105
B = 2 * A
123
106
test_spmm_petsc (A,B)
124
- I,J,V,row_partition,col_partition = generate_coo (nodes_per_dir,parts_per_dir,ranks)
125
- # index_type = PetscCall.PetscInt
126
- # value_type = PetscCall.PetscScalar
127
- # I,J,V,row_partition,col_partition = laplacian_fem(nodes_per_dir,parts_per_dir,ranks;index_type,value_type)
107
+ index_type = PetscCall. PetscInt
108
+ value_type = PetscCall. PetscScalar
109
+ I,J,V,row_partition,col_partition = laplacian_fem (nodes_per_dir,parts_per_dir,ranks;index_type,value_type)
128
110
petsc_comm = PetscCall. setup_petsc_comm (ranks)
129
111
map (I,J,V,row_partition,col_partition) do args...
130
112
petsc_coo (petsc_comm,args... )
0 commit comments