Skip to content

Commit

Permalink
specialize show
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Apr 1, 2022
1 parent d58b1b5 commit 23d4520
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/auxiliary/mpi_arrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ function TrixiMPIArray(u_local::AbstractArray{T, N}) where {T, N}
end


# Specializations of Base.show without global communication via a global `length`
# This is necessary when `show`ing `TrixiMPIArray`s only on some ranks, e.g.,
# for development.
function Base.show(io::IO, u::TrixiMPIArray)
print(io, "TrixiMPIArray wrapping ", parent(u))
end

function Base.show(io::IO, mime::MIME"text/plain", u::TrixiMPIArray)
print(io, "TrixiMPIArray wrapping ")
show(io, mime, parent(u))
end


# TODO: MPI. Adapt
# - wrap_array - done
# - wrap_array_native - should not be changed since it should return a plain `Array`
Expand Down

0 comments on commit 23d4520

Please sign in to comment.