Skip to content

Commit 23d4520

Browse files
committed
specialize show
1 parent d58b1b5 commit 23d4520

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/auxiliary/mpi_arrays.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ function TrixiMPIArray(u_local::AbstractArray{T, N}) where {T, N}
4747
end
4848

4949

50+
# Specializations of Base.show without global communication via a global `length`
51+
# This is necessary when `show`ing `TrixiMPIArray`s only on some ranks, e.g.,
52+
# for development.
53+
function Base.show(io::IO, u::TrixiMPIArray)
54+
print(io, "TrixiMPIArray wrapping ", parent(u))
55+
end
56+
57+
function Base.show(io::IO, mime::MIME"text/plain", u::TrixiMPIArray)
58+
print(io, "TrixiMPIArray wrapping ")
59+
show(io, mime, parent(u))
60+
end
61+
62+
5063
# TODO: MPI. Adapt
5164
# - wrap_array - done
5265
# - wrap_array_native - should not be changed since it should return a plain `Array`

0 commit comments

Comments
 (0)