trixi-framework / Trixi.jl

Trixi.jl: Adaptive high-order numerical simulations of conservation laws in Julia
https://trixi-framework.github.io/Trixi.jl
MIT License
505 stars 98 forks source link

Fix timings for `SemidiscretizationCoupled` #1978

Closed efaulhaber closed 2 weeks ago

efaulhaber commented 2 weeks ago

The rhs! calls were counted as "copy to coupled boundaries", producing this weird timer output:

 Section                          ncalls     time    %tot     avg     alloc    %tot      avg
 ───────────────────────────────────────────────────────────────────────────────────────────
 copy to coupled boundaries        7.20k    4.72s   81.7%   656μs   3.31GiB   96.2%   481KiB
   ~copy to coupled boundaries~    7.20k    4.33s   74.9%   601μs   3.31GiB   96.2%   481KiB
   rhs!                            21.6k    395ms    6.8%  18.3μs   5.14KiB    0.0%    0.24B
     volume integral               21.6k    209ms    3.6%  9.65μs     0.00B    0.0%    0.00B
     interface flux                21.6k   62.8ms    1.1%  2.91μs     0.00B    0.0%    0.00B
     surface integral              21.6k   46.5ms    0.8%  2.15μs     0.00B    0.0%    0.00B
     boundary flux                 21.6k   32.6ms    0.6%  1.51μs     0.00B    0.0%    0.00B
     Jacobian                      21.6k   21.3ms    0.4%   985ns     0.00B    0.0%    0.00B
     reset ∂u/∂t                   21.6k   12.9ms    0.2%   597ns     0.00B    0.0%    0.00B
     ~rhs!~                        21.6k   10.1ms    0.2%   467ns   5.14KiB    0.0%    0.24B
     source terms                  21.6k    247μs    0.0%  11.4ns     0.00B    0.0%    0.00B

The new output looks like this:

 Section                      ncalls     time    %tot     avg     alloc    %tot      avg
 ───────────────────────────────────────────────────────────────────────────────────────
 copy to coupled boundaries    3.60k    4.01s   88.3%  1.11ms   3.28GiB   99.3%   956KiB
 rhs!                          21.6k    388ms    8.5%  18.0μs   5.14KiB    0.0%    0.24B
   volume integral             21.6k    207ms    4.6%  9.58μs     0.00B    0.0%    0.00B
   interface flux              21.6k   61.0ms    1.3%  2.82μs     0.00B    0.0%    0.00B
   surface integral            21.6k   46.3ms    1.0%  2.14μs     0.00B    0.0%    0.00B
   boundary flux               21.6k   31.6ms    0.7%  1.46μs     0.00B    0.0%    0.00B
   Jacobian                    21.6k   21.1ms    0.5%   976ns     0.00B    0.0%    0.00B
   reset ∂u/∂t                 21.6k   11.6ms    0.3%   536ns     0.00B    0.0%    0.00B
   ~rhs!~                      21.6k   9.07ms    0.2%   420ns   5.14KiB    0.0%    0.24B
   source terms                21.6k    254μs    0.0%  11.8ns     0.00B    0.0%    0.00B
github-actions[bot] commented 2 weeks ago

Review checklist

This checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging.

Purpose and scope

Code quality

Documentation

Testing

Performance

Verification

Created with :heart: by the Trixi.jl community.

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.14%. Comparing base (c090422) to head (a3d3cf5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1978 +/- ## ========================================== - Coverage 96.14% 96.14% -0.00% ========================================== Files 460 460 Lines 36926 36925 -1 ========================================== - Hits 35499 35498 -1 Misses 1427 1427 ``` | [Flag](https://app.codecov.io/gh/trixi-framework/Trixi.jl/pull/1978/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=trixi-framework) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/trixi-framework/Trixi.jl/pull/1978/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=trixi-framework) | `96.14% <100.00%> (-<0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=trixi-framework#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.