Trixi.jl icon indicating copy to clipboard operation
Trixi.jl copied to clipboard

Trixi displays local, and not global, number of elements / DOFs

Open benegee opened this issue 1 year ago • 4 comments

When doing parallel computations with Trixi, I noticed that the local number of elements or degrees of freedom, and not the global number, is printed.

For example:

mpiexec() do cmd
  run(`$cmd -n 2 $(Base.julia_cmd()) -e 'using Trixi; trixi_include("Trixi.jl/examples/p4est_2d_dgsem/elixir_euler_sedov.jl")'`)
end

runs a 2D P4est example with 256 elements and 6400 DOFs on 2 processes, and the output is:

[...]
│ SemidiscretizationHyperbolic                                                                     │
[...]
│ total #DOFs: ……………………………………………… 3200                                                             │
[...]
│ P4estMesh{2, Float64}                                                                            │
[...]
│ current #cells: ……………………………………… 128                                                              │

Likewise the analysis callback prints:

[...]
 #DOF:                     3200                alloc'd memory:        343.208 MiB
 #elements:                 128
[...]

I would have expected to see the global number. So, this is just a question whether displaying the local number is intended.

benegee avatar Aug 29 '23 15:08 benegee

I think both numbers would be interesting. @sloede?

ranocha avatar Aug 29 '23 15:08 ranocha

I have stumbled across this issue before as well. Thus I agree, it would be great if we could show the global counts instead of the rank 0 counts in the aforementioned locations. Would you be willing to create a PR for this, @bgeihe? I'd be happy to assist in case of questions.

sloede avatar Aug 30 '23 06:08 sloede

Sure!

But to clarify: Show global numbers instead of local ones? OR Show global and local numbers?

benegee avatar Aug 30 '23 07:08 benegee

To me, showing only the global numbers makes more sense. I am not sure exactly how much information one can gain from only knowing the local number of elements/DOFs on rank 0 🤷‍♂️

sloede avatar Aug 30 '23 07:08 sloede