diff --git a/Project.toml b/Project.toml index 9df96d6efa..a6911d4e2c 100644 --- a/Project.toml +++ b/Project.toml @@ -104,7 +104,7 @@ TimerOutputs = "0.5.7" Triangulate = "2.2" TriplotBase = "0.1" TriplotRecipes = "0.1" -TrixiBase = "0.1.1" +TrixiBase = "0.1.3" UUIDs = "1.6" julia = "1.8" diff --git a/src/Trixi.jl b/src/Trixi.jl index 3a882d0962..b8364eef44 100644 --- a/src/Trixi.jl +++ b/src/Trixi.jl @@ -64,13 +64,13 @@ using Static: Static, One, True, False using StaticArrays: StaticArrays, MVector, MArray, SMatrix, @SMatrix using StrideArrays: PtrArray, StrideArray, StaticInt @reexport using StructArrays: StructArrays, StructArray -using TimerOutputs: TimerOutputs, @notimeit, TimerOutput, print_timer, reset_timer! +using TimerOutputs: TimerOutputs, @notimeit, print_timer, reset_timer! using Triangulate: Triangulate, TriangulateIO export TriangulateIO # for type parameter in DGMultiMesh using TriplotBase: TriplotBase using TriplotRecipes: DGTriPseudocolor @reexport using TrixiBase: trixi_include -using TrixiBase: TrixiBase +using TrixiBase: TrixiBase, @trixi_timeit, timer @reexport using SimpleUnPack: @unpack using SimpleUnPack: @pack! using DataStructures: BinaryHeap, FasterForward, extract_all! diff --git a/src/auxiliary/auxiliary.jl b/src/auxiliary/auxiliary.jl index 972a748c56..6259e93673 100644 --- a/src/auxiliary/auxiliary.jl +++ b/src/auxiliary/auxiliary.jl @@ -4,19 +4,6 @@ include("containers.jl") include("math.jl") -# Enable debug timings `@trixi_timeit timer() "name" stuff...`. -# This allows us to disable timings completely by executing -# `TimerOutputs.disable_debug_timings(Trixi)` -# and to enable them again by executing -# `TimerOutputs.enable_debug_timings(Trixi)` -timeit_debug_enabled() = true - -# Store main timer for global timing of functions -const main_timer = TimerOutput() - -# Always call timer() to hide implementation details -timer() = main_timer - # By default, Julia/LLVM does not use fused multiply-add operations (FMAs). # Since these FMAs can increase the performance of many numerical algorithms, # we need to opt-in explicitly. @@ -249,33 +236,6 @@ macro threaded(expr) end) end -# @trixi_timeit timer() "some label" expression -# -# Basically the same as a special case of `@timeit_debug` from -# [TimerOutputs.jl](https://github.com/KristofferC/TimerOutputs.jl), -# but without `try ... finally ... end` block. Thus, it's not exception-safe, -# but it also avoids some related performance problems. Since we do not use -# exception handling in Trixi.jl, that's not really an issue. -macro trixi_timeit(timer_output, label, expr) - timeit_block = quote - if timeit_debug_enabled() - local to = $(esc(timer_output)) - local enabled = to.enabled - if enabled - local accumulated_data = $(TimerOutputs.push!)(to, $(esc(label))) - end - local b₀ = $(TimerOutputs.gc_bytes)() - local t₀ = $(TimerOutputs.time_ns)() - end - local val = $(esc(expr)) - if timeit_debug_enabled() && enabled - $(TimerOutputs.do_accumulate!)(accumulated_data, t₀, b₀) - $(TimerOutputs.pop!)(to) - end - val - end -end - """ @autoinfiltrate @autoinfiltrate condition::Bool