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

`p4est` bindings generated with Clang.jl

Open ranocha opened this issue 1 year ago • 3 comments

This is the Trixi.jl counterpart of https://github.com/trixi-framework/P4est.jl/pull/49 to find out what we need to do there to support everything we use in Trixi.jl. TODOs:

  • [ ] every comment # TODO: Clang
  • [ ] breaking release because of different example calling stuff
  • [ ] much more...

ranocha avatar Jul 19 '22 13:07 ranocha

Right now on this branch with https://github.com/trixi-framework/P4est.jl/pull/49/commits/db12e75e8832c10e2297e1c4bf605236e15c33e9 in https://github.com/trixi-framework/P4est.jl/pull/49, I get locally:

julia> include("test/test_p4est_2d.jl")
[...]
[ Info: Testset elixir_mhd_rotor.jl finished in 23.541468214000002 seconds.
Test Summary: | Pass  Total
P4estMesh2D   |  182    182

ranocha avatar Jul 20 '22 12:07 ranocha

Right now on this branch with trixi-framework/P4est.jl@db12e75 in trixi-framework/P4est.jl#49, I get locally:

Great news!

sloede avatar Jul 20 '22 12:07 sloede

Based on

julia> using SnoopCompileCore

julia> invalidations = @snoopr begin
           using Trixi
           trixi_include(default_example())
       end

julia> length(uinvalidated(invalidations))

julia> trees = invalidation_trees(invalidations);

julia> trees[end-1] # something from CBinding.jl with ≈ 1000 invalidations on `main`, not present here

this should hopefully help to reduce latency.

ranocha avatar Aug 26 '22 06:08 ranocha

With the current version f3b7d19 and main at https://github.com/trixi-framework/Trixi.jl/commit/c8f4cd07d0349d8b40891386e4286165371d226d, I get the following timings (in seconds) locally using Julia v1.8.3.

Serial

julia --project=. -e '@time @eval(using OrdinaryDiffEq); 
  @time @eval(using Trixi); 
  @time @eval trixi_include(joinpath(examples_dir(), "p4est_3d_dgsem", "elixir_euler_sedov.jl"), 
                            tspan = (0.0, 1.0)); 
  @time @eval solve(ode, CarpenterKennedy2N54(williamson_condition=false),
                    dt=1.0, save_everystep=false, callback=callbacks); 
  summary_callback()'
main this PR difference
using OrdinaryDiffEq ca. 7 ca. 7
using Trixi ca. 17 ca. 16 ca. -1
trixi_include(...) ca. 63 ca. 60 ca. -3
solve(...) ca. 2 ca. 2
Time for rhs! ca. 1.5 ca. 1.5

Parallel

mpirun -np 2 julia --project=. -e '@time @eval(using OrdinaryDiffEq); 
  @time @eval(using Trixi); 
  @time @eval trixi_include(joinpath(examples_dir(), "p4est_3d_dgsem", "elixir_euler_sedov.jl"), 
                            tspan = (0.0, 1.0)); 
  @time @eval solve(ode, CarpenterKennedy2N54(williamson_condition=false),
                    dt=1.0, save_everystep=false, callback=callbacks); 
  summary_callback()'
main this PR difference
using OrdinaryDiffEq ca. 7.3 ca. 7.3
using Trixi ca. 17.5 ca. 16.5 ca. -1
trixi_include(...) ca. 70.5 ca. 67 ca. -3.5
solve(...) ca. 1 ca. 1
Time for rhs! ca. 0.78 ca. 0.78

ranocha avatar Dec 16 '22 11:12 ranocha

I will wait for CI to run and trigger the rest later. Thanks for your reviews, @sloede!

ranocha avatar Dec 23 '22 12:12 ranocha

  • Check setup on an HPC cluster

Once merged, could you maybe create an issue and assign it to @JoshuaLampert, @lchristm and @sloede ? Maybe Joshua can check this on Roci, Lars and I will check it on Hawk and JURECA.

sloede avatar Dec 23 '22 12:12 sloede

  • Check setup on an HPC cluster

Once merged, could you maybe create an issue and assign it to @JoshuaLampert, @lchristm and @sloede ? Maybe Joshua can check this on Roci, Lars and I will check it on Hawk and JURECA.

Sounds good, I will do that (#1308). Could you please give @JoshuaLampert access to Roci?

ranocha avatar Dec 23 '22 15:12 ranocha

The last point in the TODO list can also be checked now after closing #1308.

JoshuaLampert avatar Mar 15 '23 19:03 JoshuaLampert

Thanks! And done ✅

sloede avatar Mar 15 '23 19:03 sloede