Skip to content

Commit b0c43d9

Browse files
committed
More refined pretty printing
1 parent 6ee96bc commit b0c43d9

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

src/debug_array.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ function Base.show(io::IO,k::MIME"text/plain",data::DebugArray)
9090
println(io,"$index = $(data.items[i])")
9191
end
9292
end
93+
function Base.show(io::IO,data::DebugArray)
94+
print(io,"DebugArray(…)")
95+
end
9396
getany(a::DebugArray) = getany(a.items)
9497

9598
function Base.similar(a::DebugArray,::Type{T},dims::Dims) where T

src/mpi_array.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ function Base.show(io::IO,k::MIME"text/plain",data::MPIArray)
196196
MPI.Barrier(data.comm)
197197
end
198198
end
199+
function Base.show(io::IO,data::MPIArray)
200+
if MPI.Comm_rank(data.comm) == 0
201+
print(io,"MPIArray(…)")
202+
end
203+
end
199204

200205
getany(a::MPIArray) = a.item
201206
i_am_main(a::MPIArray) = MPI.Comm_rank(a.comm)+1 == MAIN

src/p_sparse_matrix.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,9 @@ function Base.show(io::IO,k::MIME"text/plain",data::PSparseMatrix)
885885
println(io,"$(m)×$(n) PSparseMatrix partitioned into $np parts of type $T")
886886
end
887887
end
888+
function Base.show(io::IO,data::PSparseMatrix)
889+
print(io,"PSparseMatrix(…)")
890+
end
888891

889892
"""
890893
local_values(a::PSparseMatrix)

src/p_vector.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ function Base.show(io::IO,k::MIME"text/plain",data::PVector)
230230
println(io,"$n-element PVector partitioned into $np parts of type $T")
231231
end
232232
end
233+
function Base.show(io::IO,data::PVector)
234+
print(io,"PVector(…)")
235+
end
233236

234237
function p_vector_cache(vector_partition,index_partition)
235238
p_vector_cache_impl(eltype(vector_partition),vector_partition,index_partition)

test/fem_example.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ function fem_example(distribute)
293293
b,cacheb = pvector(II,VV,dof_partition;reuse=true) |> fetch
294294
psparse!(A,V,cacheA) |> wait
295295
pvector!(b,VV,cacheb) |> wait
296+
display((A,cacheA))
296297

297298
x = IterativeSolvers.cg(A,b,verbose=i_am_main(rank))
298299
@test norm(x-x̂) < 1.0e-5

test/p_sparse_matrix_tests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ function p_sparse_matrix_tests(distribute)
296296
A,b,cache = psystem(I,J,V,I2,V2,rows,cols,reuse=true) |> fetch
297297
psystem!(A,b,V,V2,cache) |> wait
298298

299+
display((A,A))
300+
display((b,b))
301+
299302
#Ar = renumber(A)
300303
#br,cache = renumber(b,partition(axes(Ar,1)),reuse=true)
301304
#cr = Ar\br

0 commit comments

Comments
 (0)