@@ -81,23 +81,6 @@ function petsc_coo(petsc_comm,I,J,V,rows,cols)
8181 end
8282end
8383
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-
10184function main (distribute,params)
10285 nodes_per_dir = params. nodes_per_dir
10386 parts_per_dir = params. parts_per_dir
@@ -121,10 +104,9 @@ function main(distribute,params)
121104 @test norm (c)/ norm (b1) < tol
122105 B = 2 * A
123106 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)
128110 petsc_comm = PetscCall. setup_petsc_comm (ranks)
129111 map (I,J,V,row_partition,col_partition) do args...
130112 petsc_coo (petsc_comm,args... )
0 commit comments